Interface WorkManager
-
- All Known Implementing Classes:
WorkManagerImpl
public interface WorkManager
This is a work manager API based on CommonJ. It has been adjusted to support running outside a JEE container.- Author:
- Torkel Dominique
- See Also:
WorkManager
-
-
Field Summary
Fields Modifier and Type Field Description static long
IMMEDIATE
static long
INDEFINITE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WorkItem
schedule(Work work)
WorkItem
schedule(Work work, WorkListener wl)
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.
-
-
-
Field Detail
-
IMMEDIATE
static final long IMMEDIATE
- See Also:
WorkManager.IMMEDIATE
, Constant Field Values
-
INDEFINITE
static final long INDEFINITE
- See Also:
WorkManager.INDEFINITE
, Constant Field Values
-
-
Method Detail
-
schedule
WorkItem schedule(Work work) throws WorkException, IllegalArgumentException
- Parameters:
work
- the Work to execute- Returns:
- The workitem representing the asynchronous work. If the Work is serializable then a RemoteWorkItem is always returned.
- Throws:
WorkException
- If queuing this up results in an exception then a WorkException is thrownIllegalArgumentException
- See Also:
WorkManager.schedule(commonj.work.Work)
-
schedule
WorkItem schedule(Work work, WorkListener wl) throws WorkException, IllegalArgumentException
- Parameters:
work
- the Work to executewl
- an optional WorkListener- Returns:
- The workitem representing the asynchronous work. If the Work is serializable then a RemoteWorkItem is always returned.
- Throws:
WorkException
- If queuing this up results in an exception then a WorkException is thrownIllegalArgumentException
- See Also:
WorkManager.schedule(commonj.work.Work, commonj.work.WorkListener)
-
shutdown
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.- Parameters:
timeout
- The number of milliseconds until the shutdown is aborted.- Returns:
- true if shutdown was successful, otherwise false.
-
-