org.d_haven.event.command

Class CommandEventPipeline

public class CommandEventPipeline extends Object implements EventPipeline

Created by IntelliJ IDEA. User: bloritsch Date: Jun 14, 2004 Time: 11:32:13 PM To change this template use File | Settings | File Templates.
Field Summary
EventHandlerm_eventHandler
Pipem_incoming
Pipem_recurring
Source[]m_sources
Constructor Summary
CommandEventPipeline(EnqueuePredicate predicate, EventHandler handler)
The CommandEventPipeline is used to manage the incomming queue of commands, the queue of commands to run later, and the event handler to pass the commands to.
Method Summary
voidclear()
Run any remaining incoming commands and then clear out all the commands in the system.
voidclearHard()
Remove all the commands from the system without running any of them.
EventHandlergetEventHandler()
Used by the ThreadManager to get the EventHandler for the DefaultCommandManager.
SinkgetIncomingSink()
Provide a way to get the Sink to send new Commands to.
SinkgetRecurringSink()
Provide a way to get the Sink to requeue delayed Commands to.
Source[]getSources()
Used by the Threadmanager to get the sources that are feeding the DefaultCommandManager.
StringtoString()
Provide a string representation of the pipeline for debugging purposes.

Field Detail

m_eventHandler

private final EventHandler m_eventHandler

m_incoming

private final Pipe m_incoming

m_recurring

private final Pipe m_recurring

m_sources

private final Source[] m_sources

Constructor Detail

CommandEventPipeline

public CommandEventPipeline(EnqueuePredicate predicate, EventHandler handler)
The CommandEventPipeline is used to manage the incomming queue of commands, the queue of commands to run later, and the event handler to pass the commands to.

Parameters: predicate The predicate used to determine if we are accepting commands handler The handler used to send the events

Method Detail

clear

public void clear()
Run any remaining incoming commands and then clear out all the commands in the system.

clearHard

public void clearHard()
Remove all the commands from the system without running any of them.

getEventHandler

public final EventHandler getEventHandler()
Used by the ThreadManager to get the EventHandler for the DefaultCommandManager.

Returns: the EventHandler

getIncomingSink

public Sink getIncomingSink()
Provide a way to get the Sink to send new Commands to.

Returns: the Sink for new commands

getRecurringSink

public Sink getRecurringSink()
Provide a way to get the Sink to requeue delayed Commands to.

Returns: the Sink for delayed and repeated commands

getSources

public final Source[] getSources()
Used by the Threadmanager to get the sources that are feeding the DefaultCommandManager.

Returns: the Array of one Source

toString

public String toString()
Provide a string representation of the pipeline for debugging purposes.

Returns: the representation