Class DocumentPrintWorker
- java.lang.Object
-
- com.levigo.jadice.server.core.NodeWorker<T>
-
- com.levigo.jadice.server.core.StreamWorker<DocumentPrintNode>
-
- com.levigo.jadice.server.documentplatform.DocumentPrintWorker
-
- All Implemented Interfaces:
QualifiedLogEventReceiver,WorkerController<DocumentPrintNode>,Runnable
public class DocumentPrintWorker extends StreamWorker<DocumentPrintNode>
-
-
Constructor Summary
Constructors Constructor Description DocumentPrintWorker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize()This method may be overridden, in order do perform initialization which is necessary before the actual work is started.protected voidpostWork()This method is called immediately afterNodeWorker.work()has returned.protected voidpreWork()This method is called immediately beforeNodeWorker.work()will be called.protected voidwork(Stream stream)Implement this method in order to work on a single stream.-
Methods inherited from class com.levigo.jadice.server.core.StreamWorker
accept, reject, work
-
Methods inherited from class com.levigo.jadice.server.core.NodeWorker
abort, abortNow, addInputBundle, addOutputBundle, doAbort, doAbortNow, error, error, error, fail, fail, fail, getController, getInputBundle, getInputBundles, getJob, getLimitSupport, getNode, getOutputBundle, getOutputBundles, getServerJob, getState, getStreamTransportFactory, getTransportSender, isAbortRequested, run, setDescriptor, setJob, toString, warn, warn, warn
-
-
-
-
Method Detail
-
initialize
public void initialize() throws JobExceptionDescription copied from class:NodeWorkerThis method may be overridden, in order do perform initialization which is necessary before the actual work is started.
Caveat: this method may be called synchronously by the server master thread. Therefore the work done within this call should be kept to an absolute minimum so as not to stall the job acceptor.- Overrides:
initializein classNodeWorker<DocumentPrintNode>- Throws:
JobException- in case of initialization failure
-
preWork
protected void preWork() throws ThrowableDescription copied from class:NodeWorkerThis method is called immediately beforeNodeWorker.work()will be called.Use this method e.g. to initialize objects on the same
Threadon whichNodeWorker.work()is executed in contrast toNodeWorker.initialize()which is called on a differentThread.- Overrides:
preWorkin classNodeWorker<DocumentPrintNode>- Throws:
Throwable- in case of preparation errors- See Also:
NodeWorker.initialize(),NodeWorker.work(),NodeWorker.postWork()
-
work
protected void work(Stream stream) throws Throwable
Description copied from class:StreamWorkerImplement this method in order to work on a single stream.- Specified by:
workin classStreamWorker<DocumentPrintNode>- Parameters:
stream- theStreamto work on- Throws:
Throwable- in case of processing failure
-
postWork
protected void postWork() throws ThrowableDescription copied from class:NodeWorkerThis method is called immediately afterNodeWorker.work()has returned. It will be called even when a failure inNodeWorker.work()has occured.Use this method e.g. to finalize objects on the same
Threadon whichNodeWorker.work()is executed.- Overrides:
postWorkin classNodeWorker<DocumentPrintNode>- Throws:
Throwable- in case of post processing errors- See Also:
NodeWorker.work(),NodeWorker.preWork()
-
-