com.novell.zos.jdl
Class JobletParameterSpace

java.lang.Object
  extended by com.novell.zos.jdl.JobletParameterSpace
All Implemented Interfaces:
java.io.Serializable

public class JobletParameterSpace
extends java.lang.Object
implements java.io.Serializable

JobletParameterSpace is a slice of the ParameterSpace allocated to a Joblet. As the scheduler defines slices of the parameter space for a given schedule(), JobletParameterSpace instances are created for each Joblet. This slice of the parameter space is delivered to the resource on Joblet execution. The JobletParameterSpace can also be retrieved from the Joblet object.

Example of constructing a two row two column ParameterSpace in which schedule() will create a JobletParameterSpace instance:

 class MyJob(Job):
      job_started_event(self):
          ps = ParameterSpace()
          ps.appendRow( { "column1" : "row1 col1", "column2" :"row1 col2" } )
          ps.appendRow( { "column1" : "row2 col1", "column2" :"row2 col2" } )
          self.schedule(MyJoblet,ps,{})
 

Example of retrieving the JobletParameterSpace instances in the Joblet. Here the Joblet iterates over the two rows and prints the row contents:

 class MyJoblet(Joblet):
      joblet_started_event(self):
          rowno = 0
          parameterSpace = self.getParameterSpace()
          while parameterSpace.hasNext():
              row = parameterSpace.next()
              col1 = row["column1"]
              col2 = row["column2"]
              print "row %d col1=%s col2=%s" % (rowno,col1,col2)
              rowno += 1
 

See Also:
Serialized Form

Method Summary
 org.python.core.PyDictionary getFirst()
          Returns a dictionary representing the first row in the parameter space iteration.
 org.python.core.PyDictionary getLast()
          Returns a dictionary representing the last row in the parameter space iteration.
 boolean hasNext()
          Returns True if the iteration has more elements.
 org.python.core.PyDictionary next()
          Returns a dictionary representing a row in the parameter space iteration.
 void reset()
          Reset iteration to beginning.
 int size()
          Return number of rows in this ParameterSpace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

size

public int size()
Return number of rows in this ParameterSpace

Returns:
Number of rows

hasNext

public boolean hasNext()
Returns True if the iteration has more elements.

Returns:
True if the iterator has more elements.

next

public org.python.core.PyDictionary next()
Returns a dictionary representing a row in the parameter space iteration. Each element of the returned dictionary represents a column in the parameter space row.

Returns:
Dictionary representing the next element in the iteration.
Throws:
NoSuchElementException - iteration has no more elements.

getFirst

public org.python.core.PyDictionary getFirst()
Returns a dictionary representing the first row in the parameter space iteration.

Each element of the returned dictionary represents a column in the parameter space row.

Returns:
Dictionary representing the first row in the iteration.

getLast

public org.python.core.PyDictionary getLast()
Returns a dictionary representing the last row in the parameter space iteration.

Each element of the returned dictionary represents a column in the parameter space row. If parameter space iteration only contains one row then this returns the same row as getFirst()

Returns:
Dictionary representing the last row in the iteration.

reset

public void reset()
Reset iteration to beginning.



Copyright (c) 2011 Novell, Inc. All rights reserved.