public class DefaultBatchManager extends Object implements BatchManager
BatchManager| Constructor and Description |
|---|
DefaultBatchManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(String jobName,
String jobInstanceId)
Same as
BatchManager.stop(String, String) but definitive. |
void |
cancelAllRunningInstances()
Invokes
BatchManager.cancel(String, String) for every BatchJobInstance in
running state. |
void |
delete(String jobName,
String jobInstanceId)
Deletes the given
BatchJobInstance from persistent store |
Collection<BatchJob> |
getBatchJobs()
Returns all the
BatchJob declared in the current mule context |
Iterator<com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance> |
getExecutingInstances()
Returns the instance of
BatchJobInstance that are in an executing state |
com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance |
getJobInstance(String jobName,
String jobInstanceId)
Finds a
BatchJobInstance and returns it |
Iterator<com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance> |
getJobInstances(String jobName)
Returns all the
BatchJobInstance available for the given jobName |
void |
resume(String jobName,
String jobInstanceId)
Resumes execution of a
BatchJobInstance which was stopped through the BatchManager.stop(String, String) method. |
void |
stop(String jobName,
String jobInstanceId)
Stops the
BatchJobInstance of the given ids. |
public Collection<BatchJob> getBatchJobs()
BatchJob declared in the current mule contextgetBatchJobs in interface BatchManagerBatchJobpublic com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance getJobInstance(String jobName, String jobInstanceId) throws org.mule.runtime.api.exception.MuleException
BatchJobInstance and returns itgetJobInstance in interface BatchManagerjobName - the name of the BatchJob the BatchJobInstance belongs tojobInstanceId - the id of the BatchJobInstanceBatchJobInstance or null if not foundorg.mule.runtime.api.exception.MuleExceptionpublic Iterator<com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance> getJobInstances(String jobName)
BatchJobInstance available for the given jobNamegetJobInstances in interface BatchManagerjobName - the name of the job which instances you wantIterator of BatchJobInstancepublic Iterator<com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance> getExecutingInstances() throws Exception
BatchJobInstance that are in an executing stategetExecutingInstances in interface BatchManagerIterator of BatchJobInstanceExceptionpublic void stop(String jobName, String jobInstanceId) throws org.mule.runtime.api.exception.MuleException
BatchJobInstance of the given ids. Stopping means that no more records will be taken from the instance's
queue for processing, but the ones already in the thread pool will finish to complete their current stepstop in interface BatchManagerjobName - the name of the BatchJob the BatchJobInstance belongs tojobInstanceId - the id of the BatchJobInstanceorg.mule.runtime.api.exception.MuleExceptionpublic void resume(String jobName, String jobInstanceId) throws org.mule.runtime.api.exception.MuleException
BatchJobInstance which was stopped through the BatchManager.stop(String, String) method.
Execution is resumed by setting the job instance status back to BatchJobInstanceStatus.EXECUTING. The
BatchNotification.JOB_PROCESS_RECORDS_BEGIN notification will be fired again.resume in interface BatchManagerjobName - the name of the BatchJob that owns the BatchJobInstancejobInstanceId - the id of the BatchJobInstance to be resumedorg.mule.runtime.api.exception.MuleException - in case of unhandled errorpublic void cancel(String jobName, String jobInstanceId) throws org.mule.runtime.api.exception.MuleException
BatchManager.stop(String, String) but definitive. The instance's queue's and object stores are cleared. All the instances
resources are relinquished and cannot be regainedcancel in interface BatchManagerjobName - the name of the BatchJob the BatchJobInstance belongs tojobInstanceId - the id of the BatchJobInstanceorg.mule.runtime.api.exception.MuleExceptionpublic void cancelAllRunningInstances()
throws org.mule.runtime.api.exception.MuleException
BatchManager.cancel(String, String) for every BatchJobInstance in
running state. All running instances will be considered no matter which BatchJob they're linked tocancelAllRunningInstances in interface BatchManagerorg.mule.runtime.api.exception.MuleExceptionpublic void delete(String jobName, String jobInstanceId) throws org.mule.runtime.api.exception.MuleException
BatchJobInstance from persistent storedelete in interface BatchManagerjobName - the name of the BatchJob the BatchJobInstance belongs tojobInstanceId - the id of the BatchJobInstanceorg.mule.runtime.api.exception.MuleExceptionCopyright © 2006–2022 MuleSoft, Inc.. All rights reserved.