net.sourceforge.acelogger.execution.manager
Interface ExecutorManager

All Superinterfaces:
Identifiable
All Known Implementing Classes:
BaseExecutorManager, BaseUtilConcurrentExecutorManager, EmptyExecutorManager, PooledExecutorManager, QueuedExecutorManager, SynchronousExecutorManager

public interface ExecutorManager
extends Identifiable

A interface providing task execution abstraction.

Since:
1.0.0
Version:
1.0.0
Author:
Zardi (https://sourceforge.net/users/daniel_zardi)

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.
 void executeAll(List<Runnable> commands)
          Executes the given commands within this executor, one by one.
 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 interface net.sourceforge.acelogger.Identifiable
getIdentifier
 

Method Detail

orderProperShutdown

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.

Returns:
True if the executor shutdown process was successful; False otherwise.
Since:
1.0.0

awaitTermination

boolean awaitTermination(long terminationTimeout)
Waits the execution of pending tasks in this executor manager. This method must be called after ordering a proper shutdown.

Parameters:
terminationTimeout - The maximum time (in ms) to wait for remaining tasks to execute.
Returns:
True if the executor finished processing all of it's tasks; False if timeout was reached during the wait.
Since:
1.0.0~
See Also:
orderProperShutdown()

terminateAndRetrieveTasks

List<Runnable> terminateAndRetrieveTasks()
Terminates this executor manager, return a list of tasks that were not executed after a proper shutdown was ordered. This method should be called preferably after waiting for the tasks to execute.

Returns:
A list containing the tasks pending execution.
Since:
1.0.0
See Also:
orderProperShutdown(), awaitTermination(long)

isTerminated

boolean isTerminated()
Returns true if this executor manager has ended its execution scheduling.

Returns:
True if the executor manager was shutdown; False otherwise.
Since:
1.0.0

execute

void execute(Runnable command)
Executes the given command within this executor. This method should block until the command execution or not, this will depend on the implementation.

Parameters:
command - The task to be executed.
Since:
1.0.0

executeAll

void executeAll(List<Runnable> commands)
Executes the given commands within this executor, one by one. This method should block until the command execution or not, this will depend on the implementation.

Parameters:
commands - A list of tasks to be executed.
Since:
1.0.0


Copyright © 2007-2010 The AceLogger Team. All Rights Reserved.