public class NullAdapter extends Object implements BatchAdapter
BatchAdapter
.
Does logging but nothing else.Constructor and Description |
---|
NullAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
afterCompletion(BatchJob job,
boolean commit)
The afterCompletion method notifies a BatchAdapter that a batchjob has completed.
|
void |
afterCreation(BatchJob job)
The afterCreation method notifies a batch adapter that a batchjob has been created.
|
void |
beforeCompletion(BatchJob job)
The beforeCompletion method notifies a BatchAdapter that a BatchJob is about to complete.
|
void |
doCompensate(BatchJob job)
Will be called when a GoBack() action on the process is being performed and the goBack path crosses the corresponding batch step.
|
void |
doPoll(BatchJob job)
The doPoll method is being used by the executing (timer) thread to determine if a batchjob has been finished.
|
void |
doStart(BatchJob job)
The doStart Method is responsible for starting the batch job.
|
void |
startup()
Startup is called when the adapter is instantiated by the BatchManager.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onAbort, onReactivate
public void startup() throws Exception
BatchAdapter
startup
in interface BatchAdapter
Exception
public void afterCreation(BatchJob job) throws Exception
BatchAdapter
This usually happens via a Batchmanager.submitJob()
call.
It can be used to collect parameters from the process context.
If it makes any changes to the job
, job.update()
must be called.
It is typically executed from a preprocessing method of a Task
and is expected to
complete quickly.
If an Exception is thrown by afterCreation, this exception is not catched and will manifest in the context of the caller (usually a preprocessing method).
afterCreation
in interface BatchAdapter
job
- a BatchJobException
public void doStart(BatchJob job) throws Exception
BatchAdapter
It has to start the batch job in some external execution context. If it runs in the JVM itself, it is expected to complete quickly. The method is executed via the Batch Timer for each BatchJob, which is in state BatchJob.CREATED and whose starttime is either null or not in the future.
If an exception is thrown by doStart, the behaviour depends on whether retrystart is specified for the job or not. Jobs without retrystart are placed in state BatchJob.STARTERROR and a ROLLBACK is done! No further action is carried out by the system with this BatchJob. So either doStart itself has to take appropriate actions, or an administrator must check for jobs in this state manually.
Jobs with retrystart remain in state created and a new start attempt will be made in the future.
doStart can make use of one of the methods BatchManager.markJobError(), BatchManager.markJobFinished() and BatchManager.markSuspendRetry() to mark the job as being erroneous, as being finished or to suspend further start attempts.
doStart
in interface BatchAdapter
job
- a BatchJobException
public void doPoll(BatchJob job) throws Exception
BatchAdapter
If doPoll returns or throws an exception, the state of the job remains unchanged. doPoll can make use of one of the methods BatchManager.markJobError(), BatchManager.markJobFinished() and BatchManager.markJobSuspendPoll() to mark the job as being erroneous, as being finished or to suspend further poll attempts.
doPoll
in interface BatchAdapter
job
- a BatchJobException
public void beforeCompletion(BatchJob job) throws Exception
BatchAdapter
BatchJob.FINISHED
),BatchManager.completeJob(BatchJob)
for a BatchJob with jobstate BatchJob.STARTED
The method can be used to transfer results from the execution context of the finished jobs to the process context.
If an exception is thrown by beforeCompletion, the BatchManager places the job in state BatchJob.FINISHERROR. No further action is carried out by the system with this BatchJob. So either beforeCompletion itself takes appropriate actions, or handling is done in afterCompletion, or an administrator must check for jobs in this state manually.
beforeCompletion
in interface BatchAdapter
job
- a BatchJobException
public void afterCompletion(BatchJob job, boolean commit) throws Exception
BatchAdapter
afterCompletion
in interface BatchAdapter
job
- a BatchJobcommit
- True if the job has been completed, false if there were errors.Exception
public void doCompensate(BatchJob job) throws Exception
BatchAdapter
doCompensate
in interface BatchAdapter
job
- a BatchJobException
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.