com.ibm.websphere.batch.context

Class JobStepContext

  1. java.lang.Object
  2. extended bycom.ibm.ws.batch.context.JobStepContextBase
  3. extended bycom.ibm.websphere.batch.context.JobStepContext
All implemented interfaces:
com.ibm.batch.api.context.JobStepContext, java.io.Serializable

  1. public class JobStepContext
  2. extends com.ibm.ws.batch.context.JobStepContextBase
JobStepContext provides a common workarea accessible to all programming model artifacts that comprise a batch job step. The context object is available for the lifespan of the batch job step. The following objects belonging to a particular job step may access the context object for that job step:
See Also:
Serialized Form

Constructor Summary

Constructor and Description
JobStepContext()

Method Summary

Modifier and Type Method and Description
  1. void
addRetryListener(RetryListener retryListener)
  1. java.lang.String
getJobID()
Returns job name of current job.
  1. java.io.Externalizable
getJobLevelPersistentUserData()
Return the persistent job-level user data object for this job
  1. java.util.Properties
getJobLevelProperties()
  1. java.lang.Object
getJobLevelTransientUserData()
Return the transient job-level user data object for this job
  1. java.lang.Object
getJobLevelUserData()
Deprecated. Please use getJobLevelTransientUserData APIs instead.
  1. java.util.Properties
getJobListenerProperties()
Return the job-level properties object
  1. JobStepID
getJobStepID()
Returns JobStepID object for current step.
  1. RecordMetrics
getRecordMetrics(java.lang.String bdsname)
Return the bds-level metrics (skip and records per second)
  1. int
getReturnCode()
Return the return code explicitly set by the user using setReturnCode.
  1. java.sql.Connection
getSharedSQLConnection()
  1. java.lang.String
getStepID()
Returns step name of current step.
  1. java.io.Externalizable
getStepLevelPersistentData()
Deprecated. Please use getJobLevelPersistentUserData API instead.
  1. java.lang.Object
getStepLevelTransientUserData()
Returns the transient user data stored in this context for this step
  1. StepMetrics
getStepMetrics()
Return the step-level metrics (time and retry)
  1. java.lang.String
getSubmitterID()
Return the user id of the user who submits this job
  1. java.lang.String
getUserAccountingId()
Return the accounting id set by the user in the submitted xJCL
  1. com.ibm.batch.spi.IUserControlledTransaction
getUserControlledTransaction()
  1. java.lang.Object
getUserData()
Deprecated. Please use getStepLevelTransientUserData API instead.
  1. java.lang.Object
getUserException()
Return any exception thrown during processJobStep saved by the runtime
  1. void
setJobLevelPersistentUserData(java.io.Externalizable ext)
Return the persistent job-level user data object for this job
  1. void
setJobLevelTransientUserData(java.lang.Object obj)
Set the transient job-level user data object for this job
  1. void
setJobLevelUserData(java.lang.Object o)
Deprecated. Please use setJobLevelTransientUserData API instead.
  1. void
setReturnCode(int rc)
To be used mainly by CI jobs to communicate return code back to the caller.
  1. void
setStepLevelPersistentData(java.io.Externalizable o)
Deprecated. Please use setJobLevelPesistentUserData API instead.
  1. void
setStepLevelTransientUserData(java.lang.Object obj)
Set the transient user data stored in this context for this step
  1. void
setUserAccountingId(java.lang.String o)
Deprecated. This interface will likely be removed in a future release.
  1. void
setUserControlledTransaction(com.ibm.batch.spi.IUserControlledTransaction uTran)
  1. void
setUserData(java.lang.Object o)
Deprecated. Please use setStepLevelTransientUserData API instead.
  1. void
setUserException(java.lang.Object o)
Exceptions thrown while executing user code can be saved in the context using this method
Methods inherited from class com.ibm.ws.batch.context.JobStepContextBase
clearRecordMetrics, getPOJOStep, getProperties, getRecordMetrics, getRetryHandler, isReturnCodeSet, serializeRecordMetrics, serializeStepLevelData, setIsReturnCodeSet, setJobID, setJobLevelProperties, setJobListenerProperties, setPOJOStep, setProperties, setRecordMetrics, setRecordMetricsFromBlob, setRetryHandler, setSharedSQLConnection, setStepID, setStepLevelDataFromBlob, setStepLevelDataFromBlob, setStepMetrics, setSubmitterID
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

JobStepContext

  1. public JobStepContext()

Method Detail

getUserControlledTransaction

  1. public com.ibm.batch.spi.IUserControlledTransaction getUserControlledTransaction( )
Specified by:
getUserControlledTransaction in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getUserControlledTransaction in class com.ibm.ws.batch.context.JobStepContextBase

setUserControlledTransaction

  1. public void setUserControlledTransaction( com.ibm.batch.spi.IUserControlledTransaction uTran)
Overrides:
setUserControlledTransaction in class com.ibm.ws.batch.context.JobStepContextBase

getUserData

  1. @Deprecated
  2. public java.lang.Object getUserData( )
Deprecated. Please use getStepLevelTransientUserData API instead.
Returns the user data stored in this context.
Specified by:
getUserData in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getUserData in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
user data object

setUserData

  1. @Deprecated
  2. public void setUserData( java.lang.Object o)
Deprecated. Please use setStepLevelTransientUserData API instead.
Set user data object in this context.
Specified by:
setUserData in interface com.ibm.batch.api.context.JobStepContext
Overrides:
setUserData in class com.ibm.ws.batch.context.JobStepContextBase

getJobID

  1. public java.lang.String getJobID( )
Returns job name of current job.
Specified by:
getJobID in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getJobID in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
job name

getStepID

  1. public java.lang.String getStepID( )
Returns step name of current step.
Specified by:
getStepID in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getStepID in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
step name

getJobStepID

  1. public JobStepID getJobStepID()
Returns JobStepID object for current step. This object is required to retrieve batch data stream objects from the BatchDataStreamMgr.
Specified by:
getJobStepID in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getJobStepID in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
JobStepID for this job step.

getUserException

  1. public java.lang.Object getUserException( )
Return any exception thrown during processJobStep saved by the runtime
Specified by:
getUserException in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getUserException in class com.ibm.ws.batch.context.JobStepContextBase
Returns:

setUserException

  1. public void setUserException(java.lang.Object o)
Exceptions thrown while executing user code can be saved in the context using this method
Overrides:
setUserException in class com.ibm.ws.batch.context.JobStepContextBase
Parameters:
o -

getReturnCode

  1. public int getReturnCode()
Return the return code explicitly set by the user using setReturnCode. This return code overrides the one returned by destroyJobStep for batch jobs
Specified by:
getReturnCode in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getReturnCode in class com.ibm.ws.batch.context.JobStepContextBase
Returns:

setReturnCode

  1. public void setReturnCode(int rc)
To be used mainly by CI jobs to communicate return code back to the caller.
Specified by:
setReturnCode in interface com.ibm.batch.api.context.JobStepContext
Overrides:
setReturnCode in class com.ibm.ws.batch.context.JobStepContextBase
Parameters:
rc -

getUserAccountingId

  1. public java.lang.String getUserAccountingId( )
Return the accounting id set by the user in the submitted xJCL
Specified by:
getUserAccountingId in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getUserAccountingId in class com.ibm.ws.batch.context.JobStepContextBase
Returns:

setUserAccountingId

  1. @Deprecated
  2. public void setUserAccountingId( java.lang.String o)
Deprecated. This interface will likely be removed in a future release.
set the accountingId passed via xJCL onto the context using this method
Overrides:
setUserAccountingId in class com.ibm.ws.batch.context.JobStepContextBase
Parameters:
o -

getJobListenerProperties

  1. public java.util.Properties getJobListenerProperties( )
Return the job-level properties object
Specified by:
getJobListenerProperties in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getJobListenerProperties in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
properties object

getJobLevelUserData

  1. @Deprecated
  2. public java.lang.Object getJobLevelUserData( )
Deprecated. Please use getJobLevelTransientUserData APIs instead.
Return the transient job-level user data object
Specified by:
getJobLevelUserData in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getJobLevelUserData in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
user data object

setJobLevelUserData

  1. @Deprecated
  2. public void setJobLevelUserData( java.lang.Object o)
Deprecated. Please use setJobLevelTransientUserData API instead.
Sets the transient job-level user data object
Specified by:
setJobLevelUserData in interface com.ibm.batch.api.context.JobStepContext
Overrides:
setJobLevelUserData in class com.ibm.ws.batch.context.JobStepContextBase

getStepLevelPersistentData

  1. @Deprecated
  2. public java.io.Externalizable getStepLevelPersistentData( )
Deprecated. Please use getJobLevelPersistentUserData API instead.
Return the persistent step-level user data object
Specified by:
getStepLevelPersistentData in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getStepLevelPersistentData in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
persistent step-level user data object

setStepLevelPersistentData

  1. @Deprecated
  2. public void setStepLevelPersistentData( java.io.Externalizable o)
Deprecated. Please use setJobLevelPesistentUserData API instead.
Sets the persistent step-level user data object
Specified by:
setStepLevelPersistentData in interface com.ibm.batch.api.context.JobStepContext
Overrides:
setStepLevelPersistentData in class com.ibm.ws.batch.context.JobStepContextBase

getStepMetrics

  1. public StepMetrics getStepMetrics( )
Return the step-level metrics (time and retry)
Specified by:
getStepMetrics in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getStepMetrics in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
StepMetrics

getRecordMetrics

  1. public RecordMetrics getRecordMetrics( java.lang.String bdsname)
Return the bds-level metrics (skip and records per second)
Specified by:
getRecordMetrics in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getRecordMetrics in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
RecordMetrics

addRetryListener

  1. public void addRetryListener(RetryListener retryListener)
Specified by:
addRetryListener in interface com.ibm.batch.api.context.JobStepContext
Overrides:
addRetryListener in class com.ibm.ws.batch.context.JobStepContextBase

getJobLevelProperties

  1. public java.util.Properties getJobLevelProperties( )
Specified by:
getJobLevelProperties in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getJobLevelProperties in class com.ibm.ws.batch.context.JobStepContextBase

getSharedSQLConnection

  1. public java.sql.Connection getSharedSQLConnection( )
Specified by:
getSharedSQLConnection in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getSharedSQLConnection in class com.ibm.ws.batch.context.JobStepContextBase

getJobLevelTransientUserData

  1. public java.lang.Object getJobLevelTransientUserData( )
Return the transient job-level user data object for this job
Returns:
user data object

setJobLevelTransientUserData

  1. public void setJobLevelTransientUserData( java.lang.Object obj)
Set the transient job-level user data object for this job

getStepLevelTransientUserData

  1. public java.lang.Object getStepLevelTransientUserData( )
Returns the transient user data stored in this context for this step
Returns:
user data object

setStepLevelTransientUserData

  1. public void setStepLevelTransientUserData( java.lang.Object obj)
Set the transient user data stored in this context for this step

getJobLevelPersistentUserData

  1. public java.io.Externalizable getJobLevelPersistentUserData( )
Return the persistent job-level user data object for this job
Returns:
persistent job-level user data object

setJobLevelPersistentUserData

  1. public void setJobLevelPersistentUserData( java.io.Externalizable ext)
Return the persistent job-level user data object for this job

getSubmitterID

  1. public java.lang.String getSubmitterID( )
Return the user id of the user who submits this job
Specified by:
getSubmitterID in interface com.ibm.batch.api.context.JobStepContext
Overrides:
getSubmitterID in class com.ibm.ws.batch.context.JobStepContextBase
Returns:
persistent job-level user data object