类 JsrPartitionHandler

  • 所有已实现的接口:
    PartitionHandler, org.springframework.beans.factory.InitializingBean

    public class JsrPartitionHandler
    extends java.lang.Object
    implements PartitionHandler, org.springframework.beans.factory.InitializingBean
    Executes a step instance per thread using a ThreadPoolTaskExecutor in accordance with JSR-352. The results from each step is aggregated into a cumulative result.
    从以下版本开始:
    3.0
    作者:
    Michael Minella, Mahmoud Ben Hassine
    • 方法详细资料

      • getStep

        public Step getStep()
        返回:
        the step that will be executed by each partition
      • getPartitionStepNames

        public java.util.Collection<java.lang.String> getPartitionStepNames()
        返回:
        the names of each partitioned step
      • setAllowStartIfComplete

        public void setAllowStartIfComplete​(boolean allowStartIfComplete)
        参数:
        allowStartIfComplete - flag stating if the step should restart if it was complete in a previous run
      • setPartitionDataQueue

        public void setPartitionDataQueue​(java.util.Queue<java.io.Serializable> queue)
        参数:
        queue - Queue to receive the output of the PartitionCollector
      • setPartitionLock

        public void setPartitionLock​(java.util.concurrent.locks.ReentrantLock lock)
      • setPartitionMapper

        public void setPartitionMapper​(javax.batch.api.partition.PartitionMapper mapper)
        参数:
        mapper - PartitionMapper used to configure partitioning
      • setStep

        public void setStep​(Step step)
        参数:
        step - the step to be executed as a partitioned step
      • setPartitionAnalyzer

        public void setPartitionAnalyzer​(javax.batch.api.partition.PartitionAnalyzer analyzer)
        参数:
        analyzer - PartitionAnalyzer
      • setThreads

        public void setThreads​(int threads)
        参数:
        threads - the number of threads to execute the partitions to be run within. The default is the number of partitions.
      • setPartitions

        public void setPartitions​(int partitions)
        参数:
        partitions - the number of partitions to be executed
      • setPollingInterval

        public void setPollingInterval​(int pollingInterval)
        参数:
        pollingInterval - the duration of partitions completion polling interval (in milliseconds). The default value is 500ms.
      • handle

        public java.util.Collection<StepExecutionhandle​(StepExecutionSplitter stepSplitter,
                                                          StepExecution stepExecution)
                                                   throws java.lang.Exception
        从接口复制的说明: PartitionHandler
        Main entry point for PartitionHandler interface. The splitter creates all the executions that need to be farmed out, along with their input parameters (in the form of their ExecutionContext). The master step execution is used to identify the partition and group together the results logically.
        指定者:
        handle 在接口中 PartitionHandler
        参数:
        stepSplitter - a strategy for generating a collection of StepExecution instances
        stepExecution - the master step execution for the whole partition
        返回:
        a collection of completed StepExecution instances
        抛出:
        java.lang.Exception - if anything goes wrong. This allows implementations to be liberal and rely on the caller to translate an exception into a step failure as necessary.
      • createTask

        protected java.util.concurrent.FutureTask<StepExecutioncreateTask​(Step step,
                                                                            StepExecution stepExecution)
        Creates the task executing the given step in the context of the given execution.
        参数:
        step - the step to execute
        stepExecution - the given execution
        返回:
        the task executing the given step
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        指定者:
        afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
        抛出:
        java.lang.Exception