Package adams.flow.core
Class PauseStateManager
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.flow.core.PauseStateManager
-
- All Implemented Interfaces:
LoggingSupporter,SizeOfHandler,Serializable
public class PauseStateManager extends LoggingObject
Manages the pause state in the flow.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected HashSet<FlowPauseStateListener>m_Listenersthe listeners.protected booleanm_Pausedwhether the state is paused.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description PauseStateManager()Initializes the handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(FlowPauseStateListener l)Adds the specified listener.booleanisPaused()Returns whether the handler is in paused state.protected voidnotifyListeners(FlowPauseStateEvent e)Notifies all listeners.voidpause(Actor source)Pauses the flow.voidremoveListener(FlowPauseStateListener l)Removes the specified listener.voidresume(Actor source)Resumes the flow.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Listeners
protected HashSet<FlowPauseStateListener> m_Listeners
the listeners.
-
m_Paused
protected boolean m_Paused
whether the state is paused.
-
-
Method Detail
-
addListener
public void addListener(FlowPauseStateListener l)
Adds the specified listener.- Parameters:
l- the listener to add
-
removeListener
public void removeListener(FlowPauseStateListener l)
Removes the specified listener.- Parameters:
l- the listener to remove
-
notifyListeners
protected void notifyListeners(FlowPauseStateEvent e)
Notifies all listeners.- Parameters:
e- the event to send
-
pause
public void pause(Actor source)
Pauses the flow.- Parameters:
source- the flow that triggers the pausing
-
resume
public void resume(Actor source)
Resumes the flow.- Parameters:
source- the flow that triggers the resuming
-
isPaused
public boolean isPaused()
Returns whether the handler is in paused state.- Returns:
- true if in paused state
-
-