Holger's Java API

## com.antelmann.util
Class ThreadWorker.Listener.Adapter

    java.lang.Object
      com.antelmann.util.ThreadWorker.Listener.Adapter

All Implemented Interfaces:
  ThreadWorker.Listener, EventListener

Enclosing interface:
  ThreadWorker.Listener

    public static class ThreadWorker.Listener.Adapter

extends Object
implements ThreadWorker.Listener

Nested Class Summary

Nested classes/interfaces inherited from interface com.antelmann.util.ThreadWorker.Listener
`ThreadWorker.Listener.Adapter`

Constructor Summary
`ThreadWorker.Listener.Adapter()`

Method Summary
`void` `prepareTask(Executor executor, Runnable task)` called right before the ThreadWorker starts the given task.
`void` `taskPerformed(Executor executor, Runnable task, long timeTaken, Exception exceptionIfAny)` called after ThreadWorker has finished running the task.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ThreadWorker.Listener.Adapter

    public ThreadWorker.Listener.Adapter()

Method Detail

### prepareTask

    public void prepareTask(Executor executor,
                            Runnable task)
                     throws CancellationException

  Description copied from interface: `ThreadWorker.Listener`
  called right before the ThreadWorker starts the given task.

  Specified by:
    `prepareTask` in interface `ThreadWorker.Listener`
  Throws:
    `CancellationException` - to indicate that this task is not to be executed (all other exceptions thrown are ignored)

### taskPerformed

    public void taskPerformed(Executor executor,
                              Runnable task,
                              long timeTaken,
                              Exception exceptionIfAny)

  Description copied from interface: `ThreadWorker.Listener`
  called after ThreadWorker has finished running the task. The current task is not yet removed from the queue when this method is called. The running thread has ownership over the ThreadWorker when this method is called. Removing a listener in the implementation of this method is allowed.

  Specified by:
    `taskPerformed` in interface `ThreadWorker.Listener`
    `task` - the task that just finished running
    `timeTaken` - the time (in milliseconds) it took to run the task
    `exceptionIfAny` - if an Exception was thrown during task execution, it will be held by this parameter. This should be null if the task ended normally.

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads