public class AgentMonitor
extends java.lang.Object
Events and Listeners
The AgentMonitor delivers two general types of asynchronous events to registered listeners.
MonitorEvent
are delivered to the subclasses of
MonitorListener
. They pertain to individual agents and are
used to track agent status.
ExceptionEvent
are delivered to subclasses of
ExceptionListener
. They report on problems the AgentMonitor
encounters during its monitoring activities.
AgentMonitor supports the adding of a single listener object with
addXXXListener()
methods for the following listener classes:
These listeners are part of the following class hierarchy:AgentMonitorListener - for notification of agent discovery and expiration MicroAgentListMonitorListener - for notification of microagent add/remove events RuleBaseListMonitorListener - for notification of rulebase add/remove events AlertMonitorListener - to receive all alert related events ErrorExceptionListener - for notification of critical error events relating to the AgenetMonitor's ability to perform monitoring. WarningExceptionListener - for notification of warnnig events relating to the AgentMonitor's ability to perform monitoring.
They are delivered events from the following event class hierarchy:
The AgentMonitor itself is both thread-safe and thread-aware.
All MonitorEvents are delivered to the listeners in a single message dispatch thread that receives messages from agents and dispatches them to the appropriate event handler methods. The event handler methods of all MonitorListener interfaces are executed serially.
Because the event handler methods run serially, you must ensure that they complete their task and return quickly-without extended computations, and without blocking. If a method must compute at length, we recommend that it spawn a separate thread to complete its task.
Note: The documentation provided with the
MonitorListener
interface provides additional important
information regarding the handling of all MonitorEvent types.
Using the AgentMonitor Class
The correct general procedure for using the AgentMonitor class is:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CNAME |
static boolean |
DEBUG |
Constructor and Description |
---|
AgentMonitor() |
AgentMonitor(java.util.Map config) |
AgentMonitor(java.lang.String hawkDomain,
java.lang.String serverURL,
java.util.Hashtable environment,
java.lang.String licenseFile) |
AgentMonitor(java.lang.String hawkDomain,
java.lang.String host,
int port,
int tunnelMode) |
AgentMonitor(java.lang.String hawkDomain,
java.lang.String rvService,
java.lang.String rvNetwork,
java.lang.String rvDaemon,
java.lang.String licenseFile)
Constructor.
|
AgentMonitor(java.lang.String hawkDomain,
java.lang.String serverURL,
java.lang.String clientId,
java.lang.String userName,
java.lang.String password,
java.util.Hashtable environment,
java.lang.String licenseFile) |
Modifier and Type | Method and Description |
---|---|
void |
addAgentMonitorListener(AgentMonitorListener l)
Adds a AgentMonitorListener to the console.
|
void |
addAlertMonitorListener(AlertMonitorListener l)
Adds a AlertMonitorListener.
|
void |
addErrorExceptionListener(ErrorExceptionListener l)
Adds an ErrorExceptionListener.
|
void |
addMicroAgentListMonitorListener(MicroAgentListMonitorListener l)
Adds a MicroAgentListMonitorListener.
|
void |
addRuleBaseListMonitorListener(RuleBaseListMonitorListener l)
Adds a RuleBaseListMonitorListener.
|
void |
addWarningExceptionListener(WarningExceptionListener l)
Adds a WarningExceptionListener.
|
java.lang.String |
getDomainName() |
java.lang.String |
getLicenseSettings()
Deprecated.
as of TIB/Hawk version 3.1.0
|
void |
initialize()
Initializes the AgentMonitor.
|
void |
onAgentExpiredEvent(COM.TIBCO.hawk.console.nest.shared.AgentExpiredMsg msg) |
void |
onAgentInitialEvent(COM.TIBCO.hawk.console.nest.shared.AgentInitialMsg msg) |
void |
onInternalConsoleError(java.lang.String msg) |
void |
onInternalConsoleWarning(java.lang.String msg) |
void |
onMicroAgentEvent(COM.TIBCO.hawk.console.nest.shared.MicroAgentEventMsg msg) |
void |
onRuleBaseEvent(COM.TIBCO.hawk.console.nest.shared.RuleBaseEventMsg msg) |
void |
removeAgentMonitorListener(AgentMonitorListener l)
Removes an AgentMonitorListener.
|
void |
removeAlertMonitorListener(AlertMonitorListener l)
Removes a AlertMonitorListener.
|
void |
removeErrorExceptionListener(ErrorExceptionListener l)
Removes an ErrorExceptionListener.
|
void |
removeMicroAgentListMonitorListener(MicroAgentListMonitorListener l)
Removes a MicroAgentListMonitorListener.
|
void |
removeRuleBaseListMonitorListener(RuleBaseListMonitorListener l)
Removes a RuleBaseListMonitorListener.
|
void |
removeWarningExceptionListener(WarningExceptionListener l)
Removes a WarningExceptionListener.
|
void |
setEncoding(java.lang.String encoding) |
void |
setFatalErrorCallBack(COM.TIBCO.hawk.util.TransportFatalCallBack callback) |
void |
setRecoveryCallBack(COM.TIBCO.hawk.util.TransportRecoveryCallBack callback) |
void |
shutdown()
Used to gracefully shutdown the AgentMonitor.
|
public AgentMonitor(java.lang.String hawkDomain, java.lang.String rvService, java.lang.String rvNetwork, java.lang.String rvDaemon, java.lang.String licenseFile)
hawkDomain
and rvService
parameters must be
the same as the hawk domain and TIB/Rendezvous service
configuration parameters used by the agents in order to communicate with
them.hawkDomain
- the hawk domain on which to communicatervService
- the TIB/Rendezvous service parameter to use for console
communication. See the TIB/Rendezvous documentation for more
information.rvNetwork
- the TIB/Rendezvous network parameter to use for console
communication. See the TIB/Rendezvous documentation for more
information.rvDaemon
- the TIB/Rendezvous daemon parameter to use for console
communication. See the TIB/Rendezvous documentation for more
information.public AgentMonitor(java.lang.String hawkDomain, java.lang.String serverURL, java.lang.String clientId, java.lang.String userName, java.lang.String password, java.util.Hashtable environment, java.lang.String licenseFile)
public AgentMonitor(java.lang.String hawkDomain, java.lang.String serverURL, java.util.Hashtable environment, java.lang.String licenseFile)
public AgentMonitor(java.lang.String hawkDomain, java.lang.String host, int port, int tunnelMode)
public AgentMonitor()
public AgentMonitor(java.util.Map config)
public void initialize() throws ConsoleInitializationException
ConsoleInitializationException
- if some intialization error occurredjava.lang.IllegalStateException
- if called more than once.public java.lang.String getLicenseSettings()
java.lang.IllegalStateException
- if called before initialize()public void shutdown()
java.lang.IllegalStateException
- if called before initialize()public void addAgentMonitorListener(AgentMonitorListener l) throws java.util.TooManyListenersException
java.lang.IllegalStateException
- if called after initialize() or after shutdown()java.util.TooManyListenersException
- if a listener is already registeredpublic void removeAgentMonitorListener(AgentMonitorListener l)
java.lang.IllegalStateException
- if called after initialize()public void addMicroAgentListMonitorListener(MicroAgentListMonitorListener l) throws java.util.TooManyListenersException
java.lang.IllegalStateException
- if called after initialize() or after shutdown()java.util.TooManyListenersException
- if a listener is already registeredpublic void removeMicroAgentListMonitorListener(MicroAgentListMonitorListener l)
java.lang.IllegalStateException
- if called after initialize()public void addRuleBaseListMonitorListener(RuleBaseListMonitorListener l) throws java.util.TooManyListenersException
java.lang.IllegalStateException
- if called after initialize() or after shutdown()java.util.TooManyListenersException
- if a listener is already registeredpublic void removeRuleBaseListMonitorListener(RuleBaseListMonitorListener l)
java.lang.IllegalStateException
- if called after initialize()public void addAlertMonitorListener(AlertMonitorListener l) throws java.util.TooManyListenersException
java.lang.IllegalStateException
- if called after initialize() or after shutdown()java.util.TooManyListenersException
- if a listener is already registeredpublic void removeAlertMonitorListener(AlertMonitorListener l)
java.lang.IllegalStateException
- if called after initialize()public void addErrorExceptionListener(ErrorExceptionListener l) throws java.util.TooManyListenersException
java.lang.IllegalStateException
- if called after initialize() or after shutdown()java.util.TooManyListenersException
- if a listener is already registeredpublic void removeErrorExceptionListener(ErrorExceptionListener l)
java.lang.IllegalStateException
- if called after initialize()public void addWarningExceptionListener(WarningExceptionListener l) throws java.util.TooManyListenersException
java.lang.IllegalStateException
- if called after initialize() or after shutdown()java.util.TooManyListenersException
- if a listener is already registeredpublic void removeWarningExceptionListener(WarningExceptionListener l)
java.lang.IllegalStateException
- if called after initialize()public void setEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public void setFatalErrorCallBack(COM.TIBCO.hawk.util.TransportFatalCallBack callback)
public void setRecoveryCallBack(COM.TIBCO.hawk.util.TransportRecoveryCallBack callback)
public void onAgentInitialEvent(COM.TIBCO.hawk.console.nest.shared.AgentInitialMsg msg)
public void onAgentExpiredEvent(COM.TIBCO.hawk.console.nest.shared.AgentExpiredMsg msg)
public void onMicroAgentEvent(COM.TIBCO.hawk.console.nest.shared.MicroAgentEventMsg msg)
public void onRuleBaseEvent(COM.TIBCO.hawk.console.nest.shared.RuleBaseEventMsg msg)
public void onInternalConsoleError(java.lang.String msg)
public void onInternalConsoleWarning(java.lang.String msg)
public java.lang.String getDomainName()
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.