Class RemotePartitioningManagerStepBuilder
MessageChannelPartitionHandler on the manager step.
If no messagingTemplate is provided through
messagingTemplate(MessagingTemplate), this
builder will create one and set its default channel to the outputChannel
provided through
outputChannel(MessageChannel).
If a messagingTemplate is provided, it is assumed that it is fully configured
and that its default channel is set to an output channel on which requests to workers
will be sent.
- Since:
- 4.2
- Author:
- Mahmoud Ben Hassine
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
org.springframework.batch.core.step.builder.StepBuilderHelper.CommonStepProperties -
Field Summary
Fields inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
logger, properties -
Constructor Summary
ConstructorsConstructorDescriptionRemotePartitioningManagerStepBuilder(String stepName, org.springframework.batch.core.repository.JobRepository jobRepository) Create a newRemotePartitioningManagerStepBuilder. -
Method Summary
Modifier and TypeMethodDescriptionaggregator(org.springframework.batch.core.partition.StepExecutionAggregator aggregator) allowStartIfComplete(boolean allowStartIfComplete) beanFactory(org.springframework.beans.factory.BeanFactory beanFactory) Set the bean factory.org.springframework.batch.core.step.Stepbuild()gridSize(int gridSize) inputChannel(org.springframework.messaging.MessageChannel inputChannel) Set the input channel on which replies from workers will be received.listener(org.springframework.batch.core.listener.StepExecutionListener listener) messagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate) Set theMessagingTemplateto use to send data to workers.outputChannel(org.springframework.messaging.MessageChannel outputChannel) Set the output channel on which requests to workers will be sent.partitioner(String workerStepName, org.springframework.batch.core.partition.Partitioner partitioner) partitionHandler(org.springframework.batch.core.partition.PartitionHandler partitionHandler) This method will throw aUnsupportedOperationExceptionsince the partition handler of the manager step will be automatically set to an instance ofMessageChannelPartitionHandler.pollInterval(long pollInterval) How often to poll the job repository for the status of the workers.splitter(org.springframework.batch.core.partition.StepExecutionSplitter splitter) startLimit(int startLimit) step(org.springframework.batch.core.step.Step step) timeout(long timeout) When using job repository polling, the time limit to wait.Methods inherited from class org.springframework.batch.core.step.builder.PartitionStepBuilder
getAggregator, getGridSize, getPartitioner, getPartitionHandler, getSplitter, getStep, getStepName, getTaskExecutor, self, taskExecutorMethods inherited from class org.springframework.batch.core.step.builder.StepBuilderHelper
enhance, getJobRepository, getName, isAllowStartIfComplete, observationRegistry
-
Constructor Details
-
RemotePartitioningManagerStepBuilder
public RemotePartitioningManagerStepBuilder(String stepName, org.springframework.batch.core.repository.JobRepository jobRepository) Create a newRemotePartitioningManagerStepBuilder.- Parameters:
stepName- name of the manager stepjobRepository- job repository to which the step should report to- Since:
- 5.0
-
-
Method Details
-
inputChannel
public RemotePartitioningManagerStepBuilder inputChannel(org.springframework.messaging.MessageChannel inputChannel) Set the input channel on which replies from workers will be received.- Parameters:
inputChannel- the input channel- Returns:
- this builder instance for fluent chaining
-
outputChannel
public RemotePartitioningManagerStepBuilder outputChannel(org.springframework.messaging.MessageChannel outputChannel) Set the output channel on which requests to workers will be sent. By using this setter, a default messaging template will be created and the output channel will be set as its default channel.Use either this setter or
messagingTemplate(MessagingTemplate)to provide a fully configured messaging template.- Parameters:
outputChannel- the output channel.- Returns:
- this builder instance for fluent chaining
- See Also:
-
messagingTemplate
public RemotePartitioningManagerStepBuilder messagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate) Set theMessagingTemplateto use to send data to workers. The default channel of the messaging template must be set.Use either this setter to provide a fully configured messaging template or provide an output channel through
outputChannel(MessageChannel)and a default messaging template will be created.- Parameters:
messagingTemplate- the messaging template to use- Returns:
- this builder instance for fluent chaining
- See Also:
-
pollInterval
How often to poll the job repository for the status of the workers. Defaults to 10 seconds.- Parameters:
pollInterval- the poll interval value in milliseconds- Returns:
- this builder instance for fluent chaining
-
timeout
When using job repository polling, the time limit to wait. Defaults to -1 (no timeout).- Parameters:
timeout- the timeout value in milliseconds- Returns:
- this builder instance for fluent chaining
-
beanFactory
public RemotePartitioningManagerStepBuilder beanFactory(org.springframework.beans.factory.BeanFactory beanFactory) Set the bean factory.- Parameters:
beanFactory- the bean factory to use- Returns:
- this builder instance for fluent chaining
-
build
public org.springframework.batch.core.step.Step build()- Overrides:
buildin classorg.springframework.batch.core.step.builder.PartitionStepBuilder
-
partitioner
public RemotePartitioningManagerStepBuilder partitioner(String workerStepName, org.springframework.batch.core.partition.Partitioner partitioner) - Overrides:
partitionerin classorg.springframework.batch.core.step.builder.PartitionStepBuilder
-
gridSize
- Overrides:
gridSizein classorg.springframework.batch.core.step.builder.PartitionStepBuilder
-
step
- Overrides:
stepin classorg.springframework.batch.core.step.builder.PartitionStepBuilder
-
splitter
public RemotePartitioningManagerStepBuilder splitter(org.springframework.batch.core.partition.StepExecutionSplitter splitter) - Overrides:
splitterin classorg.springframework.batch.core.step.builder.PartitionStepBuilder
-
aggregator
public RemotePartitioningManagerStepBuilder aggregator(org.springframework.batch.core.partition.StepExecutionAggregator aggregator) - Overrides:
aggregatorin classorg.springframework.batch.core.step.builder.PartitionStepBuilder
-
startLimit
- Overrides:
startLimitin classorg.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.PartitionStepBuilder>
-
listener
- Overrides:
listenerin classorg.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.PartitionStepBuilder>
-
listener
public RemotePartitioningManagerStepBuilder listener(org.springframework.batch.core.listener.StepExecutionListener listener) - Overrides:
listenerin classorg.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.PartitionStepBuilder>
-
allowStartIfComplete
- Overrides:
allowStartIfCompletein classorg.springframework.batch.core.step.builder.StepBuilderHelper<org.springframework.batch.core.step.builder.PartitionStepBuilder>
-
partitionHandler
public RemotePartitioningManagerStepBuilder partitionHandler(org.springframework.batch.core.partition.PartitionHandler partitionHandler) throws UnsupportedOperationException This method will throw aUnsupportedOperationExceptionsince the partition handler of the manager step will be automatically set to an instance ofMessageChannelPartitionHandler.When building a manager step for remote partitioning using this builder, no partition handler must be provided.
- Overrides:
partitionHandlerin classorg.springframework.batch.core.step.builder.PartitionStepBuilder- Parameters:
partitionHandler- a partition handler- Returns:
- this builder instance for fluent chaining
- Throws:
UnsupportedOperationException- if a partition handler is provided
-