Class AgentMonitor
- All Implemented Interfaces:
COM.TIBCO.hawk.console.nest.console.AgentEventMonitorListener
Events and Listeners
The AgentMonitor delivers two general types of asynchronous events to registered listeners.
-
Subclasses of
MonitorEventare delivered to the subclasses ofMonitorListener. They pertain to individual agents and are used to track agent status. -
Subclasses of
ExceptionEventare delivered to subclasses ofExceptionListener. 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:
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.
These listeners are part of the following class hierarchy:
- java.util.EventListener
They are delivered events from the following event class hierarchy:
- java.util.EventObject
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:
- add any desired event listeners to receive notifications
- call initialize() to start the AgentMonitor's monitoring activities
- call shutdown() when done
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Hashtableprotected COM.TIBCO.hawk.console.nest.console.AgentEventMonitorprotected AgentMonitorListenerprotected Hashtableprotected AlertMonitorListenerstatic Stringprotected Mapstatic booleanprotected Stringprotected ErrorExceptionListenerprotected booleanprotected booleanprotected MicroAgentListMonitorListenerprotected AgentMonitorListenerprotected AlertMonitorListenerprotected ErrorExceptionListenerprotected MicroAgentListMonitorListenerprotected RuleBaseListMonitorListenerprotected WarningExceptionListenerprotected COM.TIBCO.hawk.console.hawkeye.Providerprotected RuleBaseListMonitorListenerprotected COM.TIBCO.hawk.console.hawkeye.AgentMonitorTransportprotected WarningExceptionListener -
Constructor Summary
ConstructorsConstructorDescriptionAgentMonitor(String hawkDomain, String host, int port, int tunnelMode) AgentMonitor(String hawkDomain, String rvService, String rvNetwork, String rvDaemon, String licenseFile) Constructor.AgentMonitor(String hawkDomain, String serverURL, String clientId, String userName, String password, Hashtable environment, String licenseFile) AgentMonitor(String hawkDomain, String serverURL, Hashtable environment, String licenseFile) AgentMonitor(Map config) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a AgentMonitorListener to the console.voidAdds a AlertMonitorListener.voidAdds an ErrorExceptionListener.voidAdds a MicroAgentListMonitorListener.voidAdds a RuleBaseListMonitorListener.voidAdds a WarningExceptionListener.protected voidcheckInitState(String methodName, boolean assertedInitializationState) Helper method.protected voidHelper method.Deprecated.as of TIB/Hawk version 3.1.0voidInitializes the AgentMonitor.voidonAgentExpiredEvent(COM.TIBCO.hawk.console.nest.shared.AgentExpiredMsg msg) voidonAgentInitialEvent(COM.TIBCO.hawk.console.nest.shared.AgentInitialMsg msg) voidvoidvoidonMicroAgentEvent(COM.TIBCO.hawk.console.nest.shared.MicroAgentEventMsg msg) voidonRuleBaseEvent(COM.TIBCO.hawk.console.nest.shared.RuleBaseEventMsg msg) voidRemoves an AgentMonitorListener.voidRemoves a AlertMonitorListener.voidRemoves an ErrorExceptionListener.voidRemoves a MicroAgentListMonitorListener.voidRemoves a RuleBaseListMonitorListener.voidRemoves a WarningExceptionListener.voidsetEncoding(String encoding) voidsetFatalErrorCallBack(COM.TIBCO.hawk.util.TransportFatalCallBack callback) voidsetRecoveryCallBack(COM.TIBCO.hawk.util.TransportRecoveryCallBack callback) voidshutdown()Used to gracefully shutdown the AgentMonitor.
-
Field Details
-
CNAME
-
DEBUG
public static boolean DEBUG -
agentMonitorListener
-
nullAgentMonitorListener
-
microAgentListMonitorListener
-
nullMicroAgentListMonitorListener
-
ruleBaseListMonitorListener
-
nullRuleBaseListMonitorListener
-
alertMonitorListener
-
nullAlertMonitorListener
-
errorExceptionListener
-
nullErrorExceptionListener
-
warningExceptionListener
-
nullWarningExceptionListener
-
isInitialized
protected boolean isInitialized -
isShutdown
protected boolean isShutdown -
domain
-
_environment
-
transport
protected COM.TIBCO.hawk.console.hawkeye.AgentMonitorTransport transport -
config
-
agentEventMonitor
protected COM.TIBCO.hawk.console.nest.console.AgentEventMonitor agentEventMonitor -
agentTable
-
provider
protected COM.TIBCO.hawk.console.hawkeye.Provider provider
-
-
Constructor Details
-
AgentMonitor
public AgentMonitor(String hawkDomain, String rvService, String rvNetwork, String rvDaemon, String licenseFile) Constructor. The parameters are used to set up the console's communications channel. ThehawkDomainandrvServiceparameters must be the same as the hawk domain and TIB/Rendezvous service configuration parameters used by the agents in order to communicate with them.- Parameters:
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.
-
AgentMonitor
-
AgentMonitor
-
AgentMonitor
-
AgentMonitor
public AgentMonitor() -
AgentMonitor
-
-
Method Details
-
initialize
Initializes the AgentMonitor. May not be called more than once per AgentMonitor instance.- Throws:
ConsoleInitializationException- if some intialization error occurredIllegalStateException- if called more than once.
-
getLicenseSettings
Deprecated.as of TIB/Hawk version 3.1.0Used to retrieve license settings.- Throws:
IllegalStateException- if called before initialize()
-
shutdown
public void shutdown()Used to gracefully shutdown the AgentMonitor. Calling this method more than once has no effect.- Throws:
IllegalStateException- if called before initialize()
-
addAgentMonitorListener
Adds a AgentMonitorListener to the console.- Throws:
IllegalStateException- if called after initialize() or after shutdown()TooManyListenersException- if a listener is already registered
-
removeAgentMonitorListener
Removes an AgentMonitorListener.- Throws:
IllegalStateException- if called after initialize()
-
addMicroAgentListMonitorListener
public void addMicroAgentListMonitorListener(MicroAgentListMonitorListener l) throws TooManyListenersException Adds a MicroAgentListMonitorListener.- Throws:
IllegalStateException- if called after initialize() or after shutdown()TooManyListenersException- if a listener is already registered
-
removeMicroAgentListMonitorListener
Removes a MicroAgentListMonitorListener.- Throws:
IllegalStateException- if called after initialize()
-
addRuleBaseListMonitorListener
public void addRuleBaseListMonitorListener(RuleBaseListMonitorListener l) throws TooManyListenersException Adds a RuleBaseListMonitorListener.- Throws:
IllegalStateException- if called after initialize() or after shutdown()TooManyListenersException- if a listener is already registered
-
removeRuleBaseListMonitorListener
Removes a RuleBaseListMonitorListener.- Throws:
IllegalStateException- if called after initialize()
-
addAlertMonitorListener
Adds a AlertMonitorListener.- Throws:
IllegalStateException- if called after initialize() or after shutdown()TooManyListenersException- if a listener is already registered
-
removeAlertMonitorListener
Removes a AlertMonitorListener.- Throws:
IllegalStateException- if called after initialize()
-
addErrorExceptionListener
Adds an ErrorExceptionListener.- Throws:
IllegalStateException- if called after initialize() or after shutdown()TooManyListenersException- if a listener is already registered
-
removeErrorExceptionListener
Removes an ErrorExceptionListener.- Throws:
IllegalStateException- if called after initialize()
-
addWarningExceptionListener
public void addWarningExceptionListener(WarningExceptionListener l) throws TooManyListenersException Adds a WarningExceptionListener.- Throws:
IllegalStateException- if called after initialize() or after shutdown()TooManyListenersException- if a listener is already registered
-
removeWarningExceptionListener
Removes a WarningExceptionListener.- Throws:
IllegalStateException- if called after initialize()
-
checkInitState
Helper method. Checks the asserted initialization state and throws an IllegalStateException if isInitialized doesn't match it.- Parameters:
methodName- the name of the calling method.assertedInitializationState- the asserted initialization state of the console. This is the assertion being checked.- Throws:
IllegalStateException- if called before initialize()
-
checkShutdownState
protected void checkShutdownState()Helper method. Simply throws an IllegalStateException if AgentMonitor has already been shutdown. Used by all methods that can't be invoked after a shutdown. (all but shutdown itself).- Throws:
IllegalStateException- if called after shutdown();
-
setEncoding
- Throws:
UnsupportedEncodingException
-
setFatalErrorCallBack
public void setFatalErrorCallBack(COM.TIBCO.hawk.util.TransportFatalCallBack callback) -
setRecoveryCallBack
public void setRecoveryCallBack(COM.TIBCO.hawk.util.TransportRecoveryCallBack callback) -
onInternalConsoleError
- Specified by:
onInternalConsoleErrorin interfaceCOM.TIBCO.hawk.console.nest.console.AgentEventMonitorListener
-
onInternalConsoleWarning
- Specified by:
onInternalConsoleWarningin interfaceCOM.TIBCO.hawk.console.nest.console.AgentEventMonitorListener
-
getDomainName
-