|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.acelogger.execution.manager.BaseExecutorManager net.sourceforge.acelogger.execution.manager.BaseUtilConcurrentExecutorManager
public abstract class BaseUtilConcurrentExecutorManager
Abstracts all common tasks for ExecutorManager
based on ExecutorService
.
Constructor Summary | |
---|---|
BaseUtilConcurrentExecutorManager(String identifier,
ExecutorService executor)
Constructs a new BaseUtilConcurrentExecutorManager with the supplied identifier and executor service. |
Method Summary | |
---|---|
boolean |
awaitTermination(long terminationTimeout)
Waits the execution of pending tasks in this executor manager. |
void |
execute(Runnable command)
Executes the given command within this executor. |
boolean |
isTerminated()
Returns true if this executor manager has ended its execution scheduling. |
boolean |
orderProperShutdown()
Orders the proper shutdown of this executor manager, this is accomplished in most of the implementations by waiting all pending tasks or a given timeout. |
List<Runnable> |
terminateAndRetrieveTasks()
Terminates this executor manager, return a list of tasks that were not executed after a proper shutdown was ordered. |
Methods inherited from class net.sourceforge.acelogger.execution.manager.BaseExecutorManager |
---|
executeAll, getIdentifier |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseUtilConcurrentExecutorManager(String identifier, ExecutorService executor)
identifier
- The string that identifies this executor manager.executor
- The ExecutorService
that will be used to execute our tasks.Method Detail |
---|
public void execute(Runnable command)
command
- The task to be executed.public boolean isTerminated()
public boolean orderProperShutdown()
public boolean awaitTermination(long terminationTimeout)
terminationTimeout
- The maximum time (in ms) to wait for remaining tasks to execute.
ExecutorManager.orderProperShutdown()
public List<Runnable> terminateAndRetrieveTasks()
ExecutorManager.orderProperShutdown()
,
ExecutorManager.awaitTermination(long)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |