com.groiss.wf.batch
Class NullAdapter

java.lang.Object
  extended by com.groiss.wf.batch.NullAdapter
All Implemented Interfaces:
BatchAdapter

public class NullAdapter
extends java.lang.Object
implements BatchAdapter

Poor mans implementation of BatchAdapter. Does logging but nothing else.


Constructor Summary
NullAdapter()
           
 
Method Summary
 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)
           
 void doStart(BatchJob job)
          The doStart Method is reponsible for starting the batch job.
 void startup()
          Startup is called when the adapter is instanciated by the BatchManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullAdapter

public NullAdapter()
Method Detail

startup

public void startup()
Description copied from interface: BatchAdapter
Startup is called when the adapter is instanciated by the BatchManager. It can be used to setup the execution context for the BatchJobs.

Specified by:
startup in interface BatchAdapter

afterCreation

public void afterCreation(BatchJob job)
Description copied from interface: BatchAdapter
The afterCreation method notifies a batch adapter that a batchjob has been created.

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).

Specified by:
afterCreation in interface BatchAdapter
Parameters:
job - a BatchJob

doStart

public void doStart(BatchJob job)
Description copied from interface: BatchAdapter
The doStart Method is reponsible for starting the batch job.

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 BatchManager places the job in state BatchJob.STARTERROR. No furter action is carried out by the system with this BatchJob. So either doStart itself has to take appropriate actions, or an adminstratotor must check for jobs in this state manually.

Specified by:
doStart in interface BatchAdapter
Parameters:
job - a BatchJob

beforeCompletion

public void beforeCompletion(BatchJob job)
Description copied from interface: BatchAdapter
The beforeCompletion method notifies a BatchAdapter that a BatchJob is about to complete. The BatchManager calls this method for each BatchJob with jobstate = BatchJob.FINISHED, before the Task in which the BatchJob originated is finished.

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 furter 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 adminstrator must check for jobs in this state manually.

Specified by:
beforeCompletion in interface BatchAdapter
Parameters:
job - a BatchJob

afterCompletion

public void afterCompletion(BatchJob job,
                            boolean commit)
Description copied from interface: BatchAdapter
The afterCompletion method notifies a BatchAdapter that a batchjob has completed. It also tells the adapter whether the completion was successfull or not.

Specified by:
afterCompletion in interface BatchAdapter
Parameters:
job - a BatchJob
commit - True if the job has been completed, false if there were errors.

doCompensate

public void doCompensate(BatchJob job)
Specified by:
doCompensate in interface BatchAdapter


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.