public class WorkManagerImpl extends Object implements WorkManager
WorkManager
IMMEDIATE, INDEFINITE
Constructor and Description |
---|
WorkManagerImpl() |
WorkManagerImpl(ExecutorService executor) |
WorkManagerImpl(int minThreads,
int maxThreads) |
WorkManagerImpl(int minThreads,
int maxThreads,
int maxQueueSize) |
Modifier and Type | Method and Description |
---|---|
WorkItem |
schedule(Work work) |
WorkItem |
schedule(Work work,
WorkListener listener) |
boolean |
shutdown(long timeout)
This method is not part of CommonJ but is needed here since our
implementation creates threads that needs to be cleaned up.
|
public WorkManagerImpl()
public WorkManagerImpl(int minThreads, int maxThreads)
public WorkManagerImpl(int minThreads, int maxThreads, int maxQueueSize)
public WorkManagerImpl(ExecutorService executor)
public WorkItem schedule(Work work) throws WorkException, IllegalArgumentException
schedule
in interface WorkManager
work
- the Work to executeWorkException
- If queuing this up results in an exception then a WorkException is thrownIllegalArgumentException
WorkManager.schedule(commonj.work.Work)
public WorkItem schedule(Work work, WorkListener listener) throws WorkException, IllegalArgumentException
schedule
in interface WorkManager
work
- the Work to executelistener
- an optional WorkListenerWorkException
- If queuing this up results in an exception then a WorkException is thrownIllegalArgumentException
WorkManager.schedule(commonj.work.Work,
commonj.work.WorkListener)
public boolean shutdown(long timeout)
WorkManager
shutdown
in interface WorkManager
timeout
- The number of milliseconds until the shutdown is aborted.WorkManager.shutdown(long)