Top Description Methods
javax.batch.runtime.context

public Interface JobContext

Imports
java.util.Properties, javax.batch.runtime.BatchStatus

A JobContext provides information about the current job execution.

Method Summary

Modifier and TypeMethod and Description
public BatchStatus

Returns:

batch status string
getBatchStatus
()

The getBatchStatus method simply returns the batch status value set by the batch runtime into the job context.

public long

Returns:

job execution id
getExecutionId
()

The getExecutionId method returns the current job's current execution id.

public String

Returns:

exit status string
getExitStatus
()

The getExitStatus method simply returns the exit status value stored into the job context through the setExitStatus method or null.

public long

Returns:

job instance id
getInstanceId
()

The getInstanceId method returns the current job's instance id.

public String

Returns:

value of 'id' attribute from <job>
getJobName
()

Get job name

public Properties

Returns:

job level properties
getProperties
()

The getProperties method returns the job level properties specified in a job definition.

public Object

Returns:

user-specified type
getTransientUserData
()

The getTransientUserData method returns a transient data object belonging to the current Job XML execution element.

public void
setExitStatus(String
exit status string
status
)

The setExitStatus method assigns the user-specified exit status for the current job.

public void
setTransientUserData(Object
is the user-specified type
data
)

The setTransientUserData method stores a transient data object into the current batch context.

Method Detail

getBatchStatusback to summary
public BatchStatus getBatchStatus()

The getBatchStatus method simply returns the batch status value set by the batch runtime into the job context.

Returns:BatchStatus

batch status string

getExecutionIdback to summary
public long getExecutionId()

The getExecutionId method returns the current job's current execution id.

Returns:long

job execution id

getExitStatusback to summary
public String getExitStatus()

The getExitStatus method simply returns the exit status value stored into the job context through the setExitStatus method or null.

Returns:String

exit status string

getInstanceIdback to summary
public long getInstanceId()

The getInstanceId method returns the current job's instance id.

Returns:long

job instance id

getJobNameback to summary
public String getJobName()

Get job name

Returns:String

value of 'id' attribute from <job>

getPropertiesback to summary
public Properties getProperties()

The getProperties method returns the job level properties specified in a job definition.

A couple of notes:
  • There is no guarantee that the same Properties object instance is always returned in the same (job) scope.
  • Besides the properties which are defined in JSL within a child <properties> element of a <job> element, the batch runtime implementation may choose to include additional, implementation-defined properties.
Returns:Properties

job level properties

getTransientUserDataback to summary
public Object getTransientUserData()

The getTransientUserData method returns a transient data object belonging to the current Job XML execution element.

Returns:Object

user-specified type

setExitStatusback to summary
public void setExitStatus(String status)

The setExitStatus method assigns the user-specified exit status for the current job. When the job ends, the exit status of the job is the value specified through setExitStatus. If setExitStatus was not called or was called with a null value, then the exit status defaults to the batch status of the job.

Parameters
status:String

exit status string

setTransientUserDataback to summary
public void setTransientUserData(Object data)

The setTransientUserData method stores a transient data object into the current batch context.

Parameters
data:Object

is the user-specified type