public class MonitorManager extends Object implements Observable<MonitorManager.MonitorMessage>
monitorable
properties
of such nodes.
Nodes are identified by their owning process, which is an array of strings, for instance ["dataflow2", "processor5", "fish"]
To notify the (by default 0) monitors, use any of the
addPropertiesToNode(String[], Set)
,
registerNode(Object, String[], Set)
, deregisterNode(String)
methods and variants.
To register a monitor, use addObserver(Observer)
.
Modifier and Type | Class and Description |
---|---|
class |
MonitorManager.AddPropertiesMessage
Message indicating that
new properties have
been added to a node identified by given owning process . |
class |
MonitorManager.DeregisterNodeMessage
Message indicating that the node of the given
owning process is to be deregistered. |
class |
MonitorManager.MonitorMessage
Common abstract superclass for all monitor messages.
|
class |
MonitorManager.RegisterNodeMessage
Message indicating that the node of the given
owning process is to be registered. |
Modifier and Type | Field and Description |
---|---|
protected MultiCaster<MonitorManager.MonitorMessage> |
multiCaster |
Modifier | Constructor and Description |
---|---|
protected |
MonitorManager()
Protected constructor, use singleton access
getInstance() instead. |
Modifier and Type | Method and Description |
---|---|
void |
addObserver(Observer<MonitorManager.MonitorMessage> observer)
Register an
Observer |
void |
addPropertiesToNode(String[] owningProcess,
Set<MonitorableProperty<?>> newProperties)
Push new property get / set methods into the specified node.
|
void |
deregisterNode(String owningProcessIdentifier)
Remove the specified node from the monitor.
|
void |
deregisterNode(String[] owningProcess)
Remove the specified node from the monitor.
|
static MonitorManager |
getInstance()
Get the MonitorManager singleton instance.
|
List<Observer<MonitorManager.MonitorMessage>> |
getObservers()
A list of all the currently registered
Observer s |
void |
registerNode(Object workflowObject,
String owningProcessIdentifier)
Register a new node with this monitor.
|
void |
registerNode(Object workflowObject,
String[] owningProcess)
Register a new node with this monitor.
|
void |
registerNode(Object workflowObject,
String[] owningProcess,
Set<MonitorableProperty<?>> properties)
Register a new node with this monitor.
|
void |
registerNode(Object workflowObject,
String owningProcessIdentifier,
Set<MonitorableProperty<?>> properties)
Register a new node with this monitor.
|
void |
removeObserver(Observer<MonitorManager.MonitorMessage> observer)
Remove a class who is currently observing
|
protected static void |
setInstance(MonitorManager instance)
Set the MonitorManager singleton instance.
|
protected MultiCaster<MonitorManager.MonitorMessage> multiCaster
protected MonitorManager()
getInstance()
instead.public static MonitorManager getInstance()
protected static void setInstance(MonitorManager instance)
instance
- MonitorManager singleton to be returned by
getInstance()
.public void addObserver(Observer<MonitorManager.MonitorMessage> observer)
Observer
addObserver
in interface Observable<MonitorManager.MonitorMessage>
observer
- the class who wants notified of changespublic void addPropertiesToNode(String[] owningProcess, Set<MonitorableProperty<?>> newProperties)
owningProcess
- the node path to add properties, this must already be
registered in the state model, if not then this method fails
silently and does nothing.newProperties
- the set of properties to add to the specified node in the
state modelpublic void deregisterNode(String owningProcessIdentifier)
The specified process identifier must exist within the monitor.
owningProcess
- the identifier of the node to remove as a :-separated stringpublic void deregisterNode(String[] owningProcess)
The specified process identifier must exist within the monitor.
owningProcess
- the identifier of the node to remove.public List<Observer<MonitorManager.MonitorMessage>> getObservers()
Observer
sgetObservers
in interface Observable<MonitorManager.MonitorMessage>
public void registerNode(Object workflowObject, String owningProcessIdentifier)
The process identifier must not already exist within the state tree, if it does it will be ignored. Similarly the parent of the process identifier must exist, you cannot specify orphan nodes with no parent.
workflowObject
- an object within the work-flow model which has received the
data stream and caused this node to be created. This may or
may not be a top level work-flow entity such as a processor or
data-flow. It may be empty in which case null can be used but
this is not recommended (there's almost always something you
can put here, in general the code to create a new node is
contained within something that's just received a data stream
so a default approach would be to use the 'this'
meta-variable)owningProcess
- the :-separated process identifier as a string which has been
assigned to data moving through the workflow object. The list
of IDs must contain the new identifier as the last element.public void registerNode(Object workflowObject, String owningProcessIdentifier, Set<MonitorableProperty<?>> properties)
The process identifier must not already exist within the state tree, if it does it will be ignored. Similarly the parent of the process identifier must exist, you cannot specify orphan nodes with no parent.
workflowObject
- an object within the work-flow model which has received the
data stream and caused this node to be created. This may or
may not be a top level work-flow entity such as a processor or
data-flow. It may be empty in which case null can be used but
this is not recommended (there's almost always something you
can put here, in general the code to create a new node is
contained within something that's just received a data stream
so a default approach would be to use the 'this'
meta-variable)owningProcess
- the :-separated process identifier as a string which has been
assigned to data moving through the workflow object. The list
of IDs must contain the new identifier as the last element. *properties
- the set of monitor-able, and potentially steer-able,
properties which can be monitored from this node. Properties
may cache, may become invalid and may make no guarantee about
timely updates.public void registerNode(Object workflowObject, String[] owningProcess)
The process identifier must not already exist within the state tree, if it does it will be ignored. Similarly the parent of the process identifier must exist, you cannot specify orphan nodes with no parent.
workflowObject
- an object within the work-flow model which has received the
data stream and caused this node to be created. This may or
may not be a top level work-flow entity such as a processor or
data-flow. It may be empty in which case null can be used but
this is not recommended (there's almost always something you
can put here, in general the code to create a new node is
contained within something that's just received a data stream
so a default approach would be to use the 'this'
meta-variable)owningProcess
- the process identifier which has been assigned to data moving
through the work-flow object. The list of IDs must contain the
new identifier as the last element.public void registerNode(Object workflowObject, String[] owningProcess, Set<MonitorableProperty<?>> properties)
The process identifier must not already exist within the state tree, if it does it will be ignored. Similarly the parent of the process identifier must exist, you cannot specify orphan nodes with no parent.
workflowObject
- an object within the work-flow model which has received the
data stream and caused this node to be created. This may or
may not be a top level work-flow entity such as a processor or
data-flow. It may be empty in which case null can be used but
this is not recommended (there's almost always something you
can put here, in general the code to create a new node is
contained within something that's just received a data stream
so a default approach would be to use the 'this'
meta-variable)owningProcess
- the process identifier which has been assigned to data moving
through the work-flow object. The list of IDs must contain the
new identifier as the last element.properties
- the set of monitor-able, and potentially steer-able,
properties which can be monitored from this node. Properties
may cache, may become invalid and may make no guarantee about
timely updates.public void removeObserver(Observer<MonitorManager.MonitorMessage> observer)
removeObserver
in interface Observable<MonitorManager.MonitorMessage>
observer
- the class who no longer wants notifiedCopyright © 2015–2016 The Apache Software Foundation. All rights reserved.