com.novell.zos.jdl
Class JobletInfo

java.lang.Object
  extended by com.novell.zos.jdl.GridObjectInfo
      extended by com.novell.zos.jdl.JobletInfo

public class JobletInfo
extends GridObjectInfo

JobletInfo is a representation of the Joblet Grid Object created when a Job calls schedule() to create Joblets. This class provides access to a Joblet's factset and operations on a Joblet such as cancellation and sending events to a Joblet that is running on a resource. The separate Joblet class defines execution on a resource.


Method Summary
 void cancel()
          Cancel this joblet if it is waiting or running.
 void cancel(java.lang.String reason)
          Cancel this joblet if it is waiting or running.
 void fail()
          Fail a running joblet to force failover to another resource.
 void fail(java.lang.String reason)
          Fail a running joblet to force failover to another resource.
 JobletParameterSpace getParameterSpace(int jobletNumber)
          Retrieve a joblet's JobletParameterSpace instance.
 ResourceInfo getResource()
          Retrieve the ResourceInfo that is running this Joblet.
 void retry()
          Retry a running joblet to force failover to another resource.
 void retry(java.lang.String reason)
          Retry a running joblet to force failover to another resource.
 void sendEvent(java.lang.String name, org.python.core.PyDictionary params)
          Send an event from Job to a Joblet running on a resource.
 
Methods inherited from class com.novell.zos.jdl.GridObjectInfo
deleteFact, factExists, getFact, getFact, getFactLastModified, getFactNames, refresh, setArrayFact, setBooleanArrayFact, setDateArrayFact, setDateFact, setFact, setIntegerArrayFact, setRealArrayFact, setStringArrayFact, setTimeArrayFact, setTimeFact
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParameterSpace

public JobletParameterSpace getParameterSpace(int jobletNumber)
Retrieve a joblet's JobletParameterSpace instance. The JobletParameterSpace is created when schedule() is invoked with a JobletParameterSpace. The scheduler creates slices of the ParameterSpace for each joblet.

Parameters:
jobletNumber - Joblet number to retrieve JobletParameterSpace for
Returns:
JobletParameterSpace instance assigned to the given joblet number or None if not defined

getResource

public ResourceInfo getResource()
Retrieve the ResourceInfo that is running this Joblet.

Returns:
ResourceInfo instance
Throws:
java.lang.Exception - if joblet is not running on a resource

cancel

public void cancel()
Cancel this joblet if it is waiting or running. Has no effect if joblet is finished.


cancel

public void cancel(java.lang.String reason)
Cancel this joblet if it is waiting or running. Has no effect if joblet is finished.


retry

public void retry()
Retry a running joblet to force failover to another resource. If joblet has reached retry limit, then joblet ends in failed state. Has no effect if joblet is finished.


retry

public void retry(java.lang.String reason)
Retry a running joblet to force failover to another resource. If joblet has reached retry limit, then joblet ends in failed state. Has no effect if joblet is finished.

Parameters:
reason - string to store in job log

fail

public void fail()
Fail a running joblet to force failover to another resource. If joblet has reached retry limit, then joblet ends in failed state. Has no effect if joblet is finished.


fail

public void fail(java.lang.String reason)
Fail a running joblet to force failover to another resource. If joblet has reached retry limit, then joblet ends in failed state. Has no effect if joblet is finished.

Parameters:
reason - string to store in job log

sendEvent

public void sendEvent(java.lang.String name,
                      org.python.core.PyDictionary params)
Send an event from Job to a Joblet running on a resource. Joblet must be running on a resource or this event is ignored. Typically used to communicate state changes to a long running Joblet.

Parameters:
name - Name of event
params - Dictionary of parameters to send to Joblet event
Throws:
org.python.core.PyException - if event does not exist or Joblet is not running


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