com.ibm.websphere.batch.context

Class JobStepContext

  • java.lang.Object
    • com.ibm.ws.batch.context.JobStepContextBase
      • com.ibm.websphere.batch.context.JobStepContext
  • All Implemented Interfaces:
    com.ibm.batch.api.context.JobStepContext, java.io.Serializable


    public class JobStepContext
    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:
    • BatchJobStepInterface
    • BatchDataStream
    • CheckpointPolicyAlgorithm
    • ResultsAlgorithm
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      JobStepContext() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void addRetryListener(RetryListener retryListener) 
      java.lang.String getJobID()
      Returns job name of current job.
      java.io.Externalizable getJobLevelPersistentUserData()
      Return the persistent job-level user data object for this job
      java.util.Properties getJobLevelProperties() 
      java.lang.Object getJobLevelTransientUserData()
      Return the transient job-level user data object for this job
      java.lang.Object getJobLevelUserData()
      Deprecated. 
      Please use getJobLevelTransientUserData APIs instead.
      java.util.Properties getJobListenerProperties()
      Return the job-level properties object
      JobStepID getJobStepID()
      Returns JobStepID object for current step.
      RecordMetrics getRecordMetrics(java.lang.String bdsname)
      Return the bds-level metrics (skip and records per second)
      int getReturnCode()
      Return the return code explicitly set by the user using setReturnCode.
      java.sql.Connection getSharedSQLConnection() 
      java.lang.String getStepID()
      Returns step name of current step.
      java.io.Externalizable getStepLevelPersistentData()
      Deprecated. 
      Please use getJobLevelPersistentUserData API instead.
      java.lang.Object getStepLevelTransientUserData()
      Returns the transient user data stored in this context for this step
      StepMetrics getStepMetrics()
      Return the step-level metrics (time and retry)
      java.lang.String getSubmitterID()
      Return the user id of the user who submits this job
      java.lang.String getUserAccountingId()
      Return the accounting id set by the user in the submitted xJCL
      com.ibm.batch.spi.IUserControlledTransaction getUserControlledTransaction() 
      java.lang.Object getUserData()
      Deprecated. 
      Please use getStepLevelTransientUserData API instead.
      java.lang.Object getUserException()
      Return any exception thrown during processJobStep saved by the runtime
      void setJobLevelPersistentUserData(java.io.Externalizable ext)
      Return the persistent job-level user data object for this job
      void setJobLevelTransientUserData(java.lang.Object obj)
      Set the transient job-level user data object for this job
      void setJobLevelUserData(java.lang.Object o)
      Deprecated. 
      Please use setJobLevelTransientUserData API instead.
      void setReturnCode(int rc)
      To be used mainly by CI jobs to communicate return code back to the caller.
      void setStepLevelPersistentData(java.io.Externalizable o)
      Deprecated. 
      Please use setJobLevelPesistentUserData API instead.
      void setStepLevelTransientUserData(java.lang.Object obj)
      Set the transient user data stored in this context for this step
      void setUserAccountingId(java.lang.String o)
      Deprecated. 
      This interface will likely be removed in a future release.
      void setUserControlledTransaction(com.ibm.batch.spi.IUserControlledTransaction uTran) 
      void setUserData(java.lang.Object o)
      Deprecated. 
      Please use setStepLevelTransientUserData API instead.
      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

        public JobStepContext()
    • Method Detail

      • getUserControlledTransaction

        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

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

        @Deprecated
        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

        @Deprecated
        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
        Parameters:
        user - data object
      • getJobID

        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

        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

        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

        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

        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

        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

        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

        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

        @Deprecated
        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

        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

        @Deprecated
        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

        @Deprecated
        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
        Parameters:
        job-level - user data object
      • getStepLevelPersistentData

        @Deprecated
        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

        @Deprecated
        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
        Parameters:
        step-level - user data object
      • getStepMetrics

        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

        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

        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

        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

        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

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

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

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

        public void setStepLevelTransientUserData(java.lang.Object obj)
        Set the transient user data stored in this context for this step
        Parameters:
        user - data object
      • getJobLevelPersistentUserData

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

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

        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
IBM WebSphere Application ServerTM
Release 8.5