toolbox.queueing
Interface Worker

Package class diagram package Worker
All Known Implementing Classes:
LoggingServiceAsyncImpl.AsyncLoggingWorker

public interface Worker

Common interface for developing worker classes to be used by the Listener class.

Worker instances receive notification of events that are dispatched from the an event queue.


Method Summary
 void destroy()
          Worker specific cleanup can be performed here.
 void doWork(java.lang.Object event, java.lang.String listener)
          Worker specific functionality must be implemented here.
 

Method Detail

doWork

void doWork(java.lang.Object event,
            java.lang.String listener)
Worker specific functionality must be implemented here.

Everytime a Listener instance removes an event from the event Queue it is presented to this method for processing. The specific Listener instance will only continue processing events after this method has completed.

Parameters:
event - Object containing event.
listener - String containing the name of the listener that triggered this method call.

destroy

void destroy()
Worker specific cleanup can be performed here.