com.resilientedge.util.workerPool
Interface Work
- All Known Implementing Classes:
- LoggerWorker
- public interface Work
Work is any unit of work that is run on a separate thread. The implementor
is initiated from a WorkerPool instance. The request to the implementation,
is by a user of the worker pool. The requestor is responsible for providing
any work related data when the request is made.
- Author:
- jgardner
Method Summary |
void |
dispose()
This is called when the object is being removed from the worker pool. |
java.lang.Object |
doWork(java.lang.Object obj)
Do the work that is required of the implementor. |
void |
init()
Initialization is invoked after the object is instantiated, and before it
is added to a worker pool. |
init
public void init()
- Initialization is invoked after the object is instantiated, and before it
is added to a worker pool.
dispose
public void dispose()
- This is called when the object is being removed from the worker pool. It
is a chance to cleanup any resources.
doWork
public java.lang.Object doWork(java.lang.Object obj)
- Do the work that is required of the implementor. This is invoked through
the worker pool to perform a unit of work on a secondary thread.
- Parameters:
obj
- data that is provided by the requestor and should be
meaningful to the implementor, it may be null- Returns:
- an object that is returned to the listener of the worker pool
when the method ends, it may be null.
Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.