org.d_haven.event.command
public class DefaultCommandManager extends Object implements CommandManager
Source Example
// // Set up the ThreadManager that the DefaultCommandManager will use // ThreadManager threadManager = new DefaultThreadManager(); // // Set up the DefaultCommandManager // DefaultCommandManager commandManager = new DefaultCommandManager(threadManager);
Nested Class Summary | |
---|---|
static class | DefaultCommandManager.DelayedCommandInfo
This class encapsulates the information needed to keep track of
our progress executing delayed and repeated commands. |
Field Summary | |
---|---|
SwitchedEnqueuePredicate | m_enqueuePredicate |
CommandEventPipeline | m_eventPipeline |
ThreadManager | m_threads |
Constructor Summary | |
---|---|
DefaultCommandManager(ThreadManager manager)
Create the DefaultCommandManager using the supplied
ThreadManager.
|
Method Summary | |
---|---|
void | enqueueCommand(Command command)
Get the Command Sink so that you can enqueue new commands.
|
CommandFailureHandler | getCommandFailureHandler()
Get the failure handler so that DefaultCommandManager can use it
when a problem happens.
|
int | getEnqueuedCommandSize()
Get the number of currently enqueued commands. |
ThreadManager | getThreadManager()
Get the ThreadManager we are using for this CommandManager.
|
void | setCommandFailureHandler(CommandFailureHandler handler)
Set the failure handler that the application can use to override
what happens when a command failure happens.
|
void | start() |
void | stop(boolean clear) |
String | toString() |
Parameters: manager the ThreadManager to use for the command manager
Parameters: command the command to enqueue and run
Throws: SinkException if the enqueue operation cannot succeed
Returns: the failure handler.
Returns: the snapshot number of waiting commands
Returns: the ThreadManager
Parameters: handler the new Handler
Throws: NullPointerException if "handler" is null.