org.d_haven.event.command
Class CommandEventPipeline

java.lang.Object
  extended by org.d_haven.event.command.CommandEventPipeline
All Implemented Interfaces:
EventPipeline

public class CommandEventPipeline
extends java.lang.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
private  EventHandler m_eventHandler
           
private  Pipe m_incoming
           
private  Pipe m_recurring
           
private  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
 void clear()
          Run any remaining incoming commands and then clear out all the commands in the system.
 void clearHard()
          Remove all the commands from the system without running any of them.
 EventHandler getEventHandler()
          Used by the ThreadManager to get the EventHandler for the DefaultCommandManager.
 Sink getIncomingSink()
          Provide a way to get the Sink to send new Commands to.
 Sink getRecurringSink()
          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.
 java.lang.String toString()
          Provide a string representation of the pipeline for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_recurring

private final Pipe m_recurring

m_incoming

private final Pipe m_incoming

m_eventHandler

private final EventHandler m_eventHandler

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

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.

Specified by:
getSources in interface EventPipeline
Returns:
the Array of one Source

getEventHandler

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

Specified by:
getEventHandler in interface EventPipeline
Returns:
the EventHandler

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.


toString

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

Overrides:
toString in class java.lang.Object
Returns:
the representation