Class WorkerNotifier

java.lang.Object
org.opentestfactory.services.components.worker.WorkerNotifier

public class WorkerNotifier extends Object
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 Details

  • Method Details

    • doInWorker

      public void doInWorker(SynchronousTask task)
      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()