public final class Monitor
extends java.lang.Object
Monitorable
objects must
register
prior to calling
updating
its current state or reporting
transient events
.
When monitorable objects
deregisters
, the monitor
status is retracted.
This class publishes the optional
application information
.
This information is generally set once upon application
start and not changed although that is allowed. This class
also publishes the
MonitorUpdate
notification which reports to
subscribers newly registered or de-registered monitorable
objects.
Finally, this class sends
MonitoredObjectReply
replies to
MonitoredObjectRequest
messages. These replies contain
the list of currently register monitorable objects.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MONITOR_REQUEST
MONITOR_REQUEST is advertised with the subject
"net.sf.eBusx.monitor" to form this request key. |
static java.lang.String |
MONITOR_UPDATE_SUBJECT
MONITOR_UPDATE_SUBJECT is advertised with the
subject "net.sf.eBusx.monitor" to form this notification
key. |
Modifier and Type | Method and Description |
---|---|
static void |
applicationInfo(java.lang.String name,
java.lang.String version,
java.lang.String copyright,
java.lang.String description,
EField attributes)
Publishes the given application information.
|
static void |
deregister(Monitorable obj)
Removes a registered
Monitorable object from the
monitor subsystem, retracting its published status and
transient event feeds. |
static void |
register(Monitorable obj)
Registers a monitorable object.
|
static void |
transientStatus(ActionLevel actionLevel,
java.lang.String actionName,
java.lang.String actionMsg,
Monitorable obj)
Posts a one-time transient event for the given monitorable
object.
|
static void |
update(ActionLevel actionLevel,
java.lang.String actionName,
java.lang.String actionMsg,
Monitorable obj)
Updates the monitorable object on-going status with the
given parameters.
|
public static final java.lang.String MONITOR_UPDATE_SUBJECT
MONITOR_UPDATE_SUBJECT
is advertised with the
subject "net.sf.eBusx.monitor" to form this notification
key.public static final java.lang.String MONITOR_REQUEST
MONITOR_REQUEST
is advertised with the subject
"net.sf.eBusx.monitor" to form this request key.public static void applicationInfo(java.lang.String name, java.lang.String version, java.lang.String copyright, java.lang.String description, EField attributes)
name
- the application name. May not be null
or empty.version
- the application version. May not be
null
or empty.copyright
- the application copyright. May be
null
.description
- the application description. May be
null
.attributes
- the application-specific attributes.java.lang.IllegalArgumentException
- if either name
or version
is null
or empty.public static void register(Monitorable obj)
ActionLevel.NO_ACTION
,
"Registered". A Monitorable
object must
successfully register prior to
updating
is status or posting a
transient
event.obj
- register this monitorable object.java.lang.NullPointerException
- if obj
is null
.java.lang.IllegalArgumentException
- if obj
is null
or
Monitorable.instanceName()
returns a null
or empty string.update(ActionLevel, String, String, Monitorable)
,
transientStatus(ActionLevel, String, String, Monitorable)
,
deregister(Monitorable)
public static void update(ActionLevel actionLevel, java.lang.String actionName, java.lang.String actionMsg, Monitorable obj)
actionLevel
- the action level.actionName
- the action name.actionMsg
- the human-readable action message.obj
- the registered monitorable object.java.lang.NullPointerException
- if obj
is null
.java.lang.IllegalArgumentException
- if actionName
is either null
or an empty
string.java.lang.IllegalStateException
- if obj
is not registered.transientStatus(ActionLevel, String, String, Monitorable)
,
register(Monitorable)
,
deregister(Monitorable)
public static void transientStatus(ActionLevel actionLevel, java.lang.String actionName, java.lang.String actionMsg, Monitorable obj)
actionLevel
- the action level.actionName
- the action name.actionMsg
- the human-readable action message.obj
- the registered monitorable object.java.lang.NullPointerException
- if obj
is null
.java.lang.IllegalArgumentException
- if actionName
is either null
or an empty
string.java.lang.IllegalStateException
- if obj
is not registered.register(Monitorable)
,
update(ActionLevel, String, String, Monitorable)
,
deregister(Monitorable)
public static void deregister(Monitorable obj)
Monitorable
object from the
monitor subsystem, retracting its published status and
transient event feeds.obj
- remove this monitorable instance.java.lang.NullPointerException
- if obj
is null
.update(ActionLevel, String, String, Monitorable)
,
transientStatus(ActionLevel, String, String, Monitorable)
,
register(Monitorable)
Copyright © 2001 - 2024. Charles W. Rapp. All rights reserved.