public abstract class MHawkMicroAgent extends MBaseComponent
MHawkMethod
,
MHawkRegistry
Modifier and Type | Class and Description |
---|---|
static interface |
MHawkMicroAgent.UnsolicitedMsgType
Unsolicited message type.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
M_HAWK_STD_MICRO_AGENT_INFO |
static java.lang.String |
M_HAWK_STD_MICRO_AGENT_NAME |
static java.lang.String |
OPT_METH_START_ASYNC |
static java.lang.String |
OPT_METH_START_REPEAT |
static java.lang.String |
OPT_METH_STOP_REPEAT |
static java.lang.String |
REQ_METH_DESCRIBE |
static java.lang.String |
REQ_METH_HEARTBEAT |
static java.lang.String |
SUBJ_IMPLANT_MSG |
static java.lang.String |
SUBJ_IMPLANT_START |
static java.lang.String |
SUBJ_IMPLANT_STOP |
static java.lang.String |
SUBJ_MGR_DISCOVERY |
m_registry
Modifier | Constructor and Description |
---|---|
protected |
MHawkMicroAgent(MApp app,
java.lang.String name,
java.lang.String helpStr,
MSessionImpl rvSession)
Constructor
|
protected |
MHawkMicroAgent(MApp app,
java.lang.String name,
java.lang.String helpStr,
java.lang.String rvSessionName)
Constructor - allows lazy evaluation of the RV session
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
After this message is called, the application starts interacting with TIBCO Hawk.
|
void |
addMethod(MHawkMethod method) |
void |
deactivate()
After this method has been called, the application stops interacting with TIBCO Hawk.
|
MApp |
getApp() |
int |
getHawkMethodTimeout() |
java.lang.String |
getHelpString()
Return the help string for this microagent.
|
MHawkMethod |
getMethod(java.lang.String name)
Return the method specified by the name parameter.
|
java.util.Enumeration |
getMethods()
Return a list of registered methods.
|
MSessionImpl |
getSession() |
void |
sendNotification(int msgType,
java.lang.String msgTxt)
A notification is a text message posted by a TIBCO Hawk agent as
a consequence of processing an action in a rulebase.
|
void |
setHawkMethodTimeout(int iTimeout) |
void |
setMonitoredObject(java.lang.Object obj)
Convenience method to attach the specified object to be monitored to
all methods currently known to this microagent and not yet set with a monitored object.
|
void |
stopMicroAgent() |
getComponentRegistry, getName, getStatus, isActivated, remove
public static final java.lang.String M_HAWK_STD_MICRO_AGENT_NAME
public static final java.lang.String M_HAWK_STD_MICRO_AGENT_INFO
public static final java.lang.String SUBJ_IMPLANT_START
public static final java.lang.String SUBJ_IMPLANT_STOP
public static final java.lang.String SUBJ_IMPLANT_MSG
public static final java.lang.String SUBJ_MGR_DISCOVERY
public static final java.lang.String REQ_METH_DESCRIBE
public static final java.lang.String REQ_METH_HEARTBEAT
public static final java.lang.String OPT_METH_START_REPEAT
public static final java.lang.String OPT_METH_STOP_REPEAT
public static final java.lang.String OPT_METH_START_ASYNC
protected MHawkMicroAgent(MApp app, java.lang.String name, java.lang.String helpStr, MSessionImpl rvSession)
protected MHawkMicroAgent(MApp app, java.lang.String name, java.lang.String helpStr, java.lang.String rvSessionName)
public MApp getApp()
public MSessionImpl getSession()
public int getHawkMethodTimeout()
public void setHawkMethodTimeout(int iTimeout)
public java.lang.String getHelpString()
public java.util.Enumeration getMethods()
Enumeration.nextElement()
can be cast to MHawkMethod
.public MHawkMethod getMethod(java.lang.String name)
public void activate() throws MException
activate
in interface MComponent
activate
in class MBaseComponent
MException
- if any error occured while starting the microagent to listen for requests.deactivate()
public void deactivate() throws MException
deactivate
in interface MComponent
deactivate
in class MBaseComponent
MException
- on any error stopping the microagent to listen for requests.activate()
public void sendNotification(int msgType, java.lang.String msgTxt) throws MHawkException
Applications usually only respond to messages they receive from TIBCO Hawk. This method allows applications to send a notification to TIBCO Hawk. Applications using this method can asynchronously send messages without previous input from TIBCO Hawk.
The subject for the unsolicited messages should be _HAWK.AMI>
. The
last field might differ based on the notification type (INFO
, WARNING
,
ERROR
, and so forth), the ">" sign should therefore work.
To see the notification on a Hawk display, you need to write a Hawk
rule invoking the _onUnsolicited()
method of the microagent.
See TIBCO Hawk documentation for details.
msgType
- Type of notification to be sent. One of MHawkMicroAgent.UnsolicitedMsgType.WARNING
,
MHawkMicroAgent.UnsolicitedMsgType.ERROR
, MHawkMicroAgent.UnsolicitedMsgType.INFO
.msgTxt
- Notification text to be sent.MHawkException
- on any error sending an unsolicited message to TIBCO Hawk.public void setMonitoredObject(java.lang.Object obj)
public void stopMicroAgent()
public void addMethod(MHawkMethod method)