public class DefaultBatchJobInstanceStore extends BaseBatchProcessingListenerOwner implements BatchJobInstanceStore, org.mule.runtime.core.api.context.MuleContextAware, org.mule.runtime.api.lifecycle.Initialisable, org.mule.runtime.api.lifecycle.Startable
BatchJobInstanceStore that uses ObjectStore for a persistence mechanism| Constructor and Description |
|---|
DefaultBatchJobInstanceStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearFailedRecords(BatchJobInstanceAdapter jobInstance)
Removes all the failed records records stored for the given
BatchJobAdapter |
List<BatchJobInstanceAdapter> |
getExecutingInstances()
Retrieves all the
BatchJobInstance that are currently elegible for
execution. |
Iterator<Record> |
getFailedRecords(BatchJobInstanceAdapter jobInstance)
Retrieves all the records of the given
BatchJobInstanceAdapter that failed in at least one step and which execution
has finished |
BatchJobInstanceAdapter |
getJobInstance(String jobName,
String jobInstanceId)
Returns the
BatchJobInstanceAdapter for the given job and id |
<T extends com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance> |
getJobInstances(String jobName)
Returns all the
BatchJobInstance for the given job name |
void |
initialise() |
boolean |
remove(com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance jobInstance)
removes the given
BatchJobInstance |
void |
setMuleContext(org.mule.runtime.core.api.MuleContext muleContext) |
void |
start() |
void |
store(BatchJobInstanceAdapter jobInstance)
Stores the given job instance
|
void |
storeFailedRecords(BatchJobInstanceAdapter jobInstance,
Collection<Record> records)
Adds the given
Records to the list of failed records |
void |
update(BatchJobInstanceAdapter jobInstance)
updates the given job instance.
|
addBatchProcessingListener, addBatchProcessingListener, getListeners, removeBatchProcessingListener, removeBatchProcessingListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddBatchProcessingListener, addBatchProcessingListener, removeBatchProcessingListener, removeBatchProcessingListenerpublic void store(BatchJobInstanceAdapter jobInstance)
store in interface BatchJobInstanceStorejobInstance - a BatchJobInstanceAdapterpublic void update(BatchJobInstanceAdapter jobInstance)
update in interface BatchJobInstanceStorejobInstance - a BatchJobInstanceAdapterpublic boolean remove(com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance jobInstance)
BatchJobInstanceremove in interface BatchJobInstanceStorejobInstance - a BatchJobInstancetrue if the jobInstance was contained in the store. false otherwisepublic Iterator<Record> getFailedRecords(BatchJobInstanceAdapter jobInstance)
BatchJobInstanceStoreBatchJobInstanceAdapter that failed in at least one step and which execution
has finishedgetFailedRecords in interface BatchJobInstanceStorejobInstance - an instance of BatchJobInstanceAdapterIteratorpublic void clearFailedRecords(BatchJobInstanceAdapter jobInstance)
BatchJobAdapterclearFailedRecords in interface BatchJobInstanceStorejobInstance - an instance of BatchJobInstanceAdapterpublic void storeFailedRecords(BatchJobInstanceAdapter jobInstance, Collection<Record> records)
Records to the list of failed records This implementation splits the passed records into separate object stores depending on whether they're failed
or no using buffers to save IOstoreFailedRecords in interface BatchJobInstanceStorejobInstance - an instance of BatchJobInstanceAdapterrecords - a Record which processing has finishedpublic BatchJobInstanceAdapter getJobInstance(String jobName, String jobInstanceId)
BatchJobInstanceAdapter for the given job and idgetJobInstance in interface BatchJobInstanceStorejobName - the name of the owner BatchJobjobInstanceId - the id of the job instanceBatchJobInstanceAdapter or null if none exists.public <T extends com.mulesoft.mule.runtime.module.batch.api.BatchJobInstance> Iterator<T> getJobInstances(String jobName)
BatchJobInstance for the given job namegetJobInstances in interface BatchJobInstanceStorejobName - a non empty StringIterator of BatchJobInstancepublic List<BatchJobInstanceAdapter> getExecutingInstances() throws org.mule.runtime.api.exception.MuleException
BatchJobInstance that are currently elegible for
execution. This method has to be thread-safe, meaning that if two threads concurrently invoke this method, the returned list
has to be navigable and modifiable by the two threads without causing issues. This can be achieved by either returning a
synchronized list, returning different copies of the list or whatever mechanism you see fit in your case.getExecutingInstances in interface BatchJobInstanceStoreList of BatchJobInstanceorg.mule.runtime.api.exception.MuleExceptionpublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startableorg.mule.runtime.api.exception.MuleExceptionpublic 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.