Package adams.flow.control
Class RunningFlowsRegistry
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.flow.control.RunningFlowsRegistry
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
public class RunningFlowsRegistry extends LoggingObject
Used for registering running flows.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected HashMap<Integer,Flow>
m_Flows
the registered flows.protected static RunningFlowsRegistry
m_Singleton
the singleton.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFlow(Flow flow)
Adds the flow to the internal list of registered flows.protected void
finishInit()
Gets called after the initialization has finished.Flow[]
flows()
Returns the currently registered flows.Flow
getFlow(int id)
Returns the flow associated with the ID.static RunningFlowsRegistry
getSingleton()
Returns the singleton.Integer[]
ids()
Returns the IDs of the currently registered flows.protected void
initialize()
Initializes the members.void
purge()
Removes all stopped flows.void
removeFlow(int id)
Removes the flow from the internal list of registered flows.void
removeFlow(Flow flow)
Removes the flow from the internal list of registered flows.int
size()
Returns the number of flows registered.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Singleton
protected static RunningFlowsRegistry m_Singleton
the singleton.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.
-
finishInit
protected void finishInit()
Gets called after the initialization has finished.
-
size
public int size()
Returns the number of flows registered.- Returns:
- the number of flows
-
addFlow
public void addFlow(Flow flow)
Adds the flow to the internal list of registered flows.- Parameters:
flow
- the flow to add
-
getFlow
public Flow getFlow(int id)
Returns the flow associated with the ID.- Parameters:
id
- the ID of the flow to retrieve- Returns:
- the associated flow, null if none available for that ID
-
removeFlow
public void removeFlow(int id)
Removes the flow from the internal list of registered flows.- Parameters:
id
- the if of the flow to remove
-
removeFlow
public void removeFlow(Flow flow)
Removes the flow from the internal list of registered flows.- Parameters:
flow
- the flow to remove
-
flows
public Flow[] flows()
Returns the currently registered flows.- Returns:
- the current flows
-
ids
public Integer[] ids()
Returns the IDs of the currently registered flows.- Returns:
- the IDs of the current flows
-
purge
public void purge()
Removes all stopped flows.
-
getSingleton
public static RunningFlowsRegistry getSingleton()
Returns the singleton.- Returns:
- the singleon
-
-