类 JobContext

  • 所有已实现的接口:
    org.springframework.core.AttributeAccessor

    public class JobContext
    extends SynchronizedAttributeAccessor
    A context object that can be used to interrogate the current JobExecution and some of its associated properties using expressions based on bean paths. Has public getters for the job execution and convenience methods for accessing commonly used properties like the ExecutionContext associated with the job execution.
    从以下版本开始:
    3.0
    作者:
    Dave Syer, Jimmy Praet (create JobContext based on StepContext), Mahmoud Ben Hassine
    • 方法详细资料

      • getJobName

        public java.lang.String getJobName()
        Convenient accessor for current job name identifier.
        返回:
        the job name identifier of the enclosing JobInstance associated with the current JobExecution
      • getSystemProperties

        public java.util.Properties getSystemProperties()
        Convenient accessor for System properties to make it easy to access them from placeholder expressions.
        返回:
        the current System properties
      • getJobParameters

        public java.util.Map<java.lang.String,​java.lang.Object> getJobParameters()
        返回:
        a map containing the items from the JobParameters
      • registerDestructionCallback

        public void registerDestructionCallback​(java.lang.String name,
                                                java.lang.Runnable callback)
        Allow clients to register callbacks for clean up on close.
        参数:
        name - the callback id (unique attribute key in this context)
        callback - a callback to execute on close
      • close

        public void close()
        Clean up the context at the end of a step execution. Must be called once at the end of a step execution to honour the destruction callback contract from the StepScope.
      • getId

        public java.lang.String getId()
        返回:
        unique identifier for this context based on the step execution
      • equals

        public boolean equals​(java.lang.Object other)
        Extend the base class method to include the job execution itself as a key (i.e. two contexts are only equal if their job executions are the same).
        覆盖:
        equals 在类中 SynchronizedAttributeAccessor