public class DefaultBatchWorkManager extends Object implements BatchWorkManager, org.mule.runtime.core.api.context.MuleContextAware
BatchWorkManager| Constructor and Description |
|---|
DefaultBatchWorkManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
awaitStop(BatchJobInstanceAdapter jobInstance)
Makes the given
jobInstance no longer executable (further invocations to
BatchWorkManager.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 |
setBatchEngine(BatchEngine batchEngine) |
void |
setMuleContext(org.mule.runtime.core.api.MuleContext muleContext) |
void |
start() |
void |
stop() |
public void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startableorg.mule.runtime.api.exception.MuleExceptionpublic void stop()
stop in interface org.mule.runtime.api.lifecycle.Stoppablepublic void executable(com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance jobInstance)
jobInstance as an executable one. Invoking
BatchWorkManager.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 BatchWorkManager.awaitStop(BatchJobInstanceAdapter) to un-track
the job instance and properly release resources
executable in interface BatchWorkManagerjobInstance - an executable jobInstancepublic void scheduleManagementWork(Runnable work)
scheduleManagementWork in interface BatchWorkManagerwork - the task to executepublic void scheduleRecordWork(BatchTransactionContext ctx, Runnable work) throws RejectedExecutionException
MuleContext is stopped or stopping, then
the work is silently discarded and the context is rolled back.scheduleRecordWork in interface BatchWorkManagerctx - 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.public void awaitStop(BatchJobInstanceAdapter jobInstance)
jobInstance no longer executable (further invocations to
BatchWorkManager.scheduleRecordWork(BatchTransactionContext, Runnable) will fail, and also waits for the currently scheduled tasks to
complete before returningawaitStop in interface BatchWorkManagerjobInstance - an executable jobInstance@Inject @Named(value="batch.engine") public void setBatchEngine(BatchEngine batchEngine)
public void setMuleContext(org.mule.runtime.core.api.MuleContext muleContext)
setMuleContext in interface org.mule.runtime.core.api.context.MuleContextAwareCopyright © 2006–2022 MuleSoft, Inc.. All rights reserved.