public interface BatchWorkManager
extends org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable
BatchRecordWork needed to process one or many
BatchJobInstanceAdapter in parallel.
It not only manages the execution of such tasks but also the underlying Scheduler instances| Modifier and Type | Method and Description |
|---|---|
void |
awaitStop(BatchJobInstanceAdapter jobInstance)
Makes the given
jobInstance no longer executable (further invocations to
scheduleRecordWork(BatchTransactionContext, Runnable) will fail, and also waits for the currently scheduled tasks to
complete before returning |
void |
executable(com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance jobInstance)
Tracks the given
jobInstance as an executable one. |
void |
scheduleManagementWork(Runnable work)
Schedules the asynchronous execution of a job management task.
|
void |
scheduleRecordWork(BatchTransactionContext ctx,
Runnable work)
Schedules the given work to be executed.
|
void executable(com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance jobInstance)
jobInstance as an executable one. Invoking
scheduleRecordWork(BatchTransactionContext, Runnable) before registering the corresponding job instance with this
method, will result in an IllegalStateException.
Furthermore, it's the invoker's responsibility to eventually call the awaitStop(BatchJobInstanceAdapter) to un-track
the job instance and properly release resources
jobInstance - an executable jobInstancevoid scheduleRecordWork(BatchTransactionContext ctx, Runnable work) throws RejectedExecutionException
MuleContext is stopped or stopping, then
the work is silently discarded and the context is rolled back.ctx - the BatchTransactionContext referencing the
transaction of which work is a part ofwork - a javax.resource.spi.work.WorkRejectedExecutionException - if the underlying Executor cannot execute the given work.IllegalStateException - if the job instance pointed by the ctx was not previously registered through
executable(BatchJobInstance)void scheduleManagementWork(Runnable work)
work - the task to executevoid awaitStop(BatchJobInstanceAdapter jobInstance)
jobInstance no longer executable (further invocations to
scheduleRecordWork(BatchTransactionContext, Runnable) will fail, and also waits for the currently scheduled tasks to
complete before returningjobInstance - an executable jobInstanceCopyright © 2006–2022 MuleSoft, Inc.. All rights reserved.