Class WorkerNotifier
java.lang.Object
org.opentestfactory.services.components.worker.WorkerNotifier
Convenience class usable to handle
WorkerJobStarted and WorkerJobComplete. Only
recommended when start and complete are done in the same method/task. If your workload span over
several messages, do not use this class, it will cause more harm than good.- Author:
- jthebault
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoInWorker(SynchronousTask task) Execute a given method surrounded by workerStart/workerStop notification emitted before/after the task.voidvoid
-
Constructor Details
-
WorkerNotifier
-
-
Method Details
-
doInWorker
Execute a given method surrounded by workerStart/workerStop notification emitted before/after the task. The task must be synchronous and be conceptually complete at the end of the given method. If you need a task that spawn over several message treatment you shouldn't use this method.- Parameters:
task- The given you need to surround with worker notifications
-
notifyWorkerStarted
public void notifyWorkerStarted() -
notifyWorkerCompleted
public void notifyWorkerCompleted()
-