|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tuscany.sca.core.work.ThreadPoolWorkManager
public class ThreadPoolWorkManager
A thread-pool based implementation for the JSR-237 work manager.
This implementation supports only local work. TODO Elaborate the implementation.
Constructor Summary | |
---|---|
ThreadPoolWorkManager(int threadPoolSize)
Initializes the thread-pool. |
Method Summary | |
---|---|
void |
destroy()
|
WorkItem |
schedule(Work work)
Schedules a unit of work asynchronously. |
WorkItem |
schedule(Work work,
WorkListener workListener)
Schedules a unit of work asynchronously. |
boolean |
waitForAll(java.util.Collection works,
long timeout)
Wait for all the specified units of work to finish. |
java.util.Collection |
waitForAny(java.util.Collection works,
long timeout)
Wait for any of the specified units of work to finish. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadPoolWorkManager(int threadPoolSize)
threadPoolSize
- Thread-pool size.
java.lang.IllegalArgumentException
- if threadPoolSize < 1Method Detail |
---|
public WorkItem schedule(Work work) throws java.lang.IllegalArgumentException
work
- Work that needs to be scheduled.
java.lang.IllegalArgumentException
public WorkItem schedule(Work work, WorkListener workListener) throws java.lang.IllegalArgumentException
work
- Work that needs to be scheduled.workListener
- Work listener for callbacks.
java.lang.IllegalArgumentException
public boolean waitForAll(java.util.Collection works, long timeout)
works
- Units of the work that need to finish.timeout
- Timeout for waiting for the units of work to finish.public java.util.Collection waitForAny(java.util.Collection works, long timeout)
works
- Units of the work that need to finish.timeout
- Timeout for waiting for the units of work to finish.public void destroy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |