public class AmiSession extends java.lang.Object implements AmiEnabledInterface
Application that is TIB/Hawk AMI instrumented defines a set of synchronous methods, AmiMethodInterface, and/or asynchronous methods AmiAsyncMethodInterface, through which the application is monitored and managed by TIB/Hawk. Application that is TIB/Hawk AMI instrumented is also referred to as a TIB/Hawk Microagent.
An AmiSession object must be identified by a unique name, with an optional help text to describe the functionalities of the application.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_THREADS
The default maximum number of invocation processing thread this
AmiSession will create.
|
static int |
MAX_MAX_THREADS
The maximum maximum number of invocation processing thread this
AmiSession is allowed to create.
|
Constructor and Description |
---|
AmiSession(com.tibco.tibrv.TibrvTransport rvTransport,
com.tibco.tibrv.TibrvQueue rvQueue,
java.lang.String amiSessionName,
java.lang.String amiSessionDisplay,
java.lang.String amiSessionHelp)
Deprecated.
|
AmiSession(com.tibco.tibrv.TibrvTransport rvTransport,
com.tibco.tibrv.TibrvQueue rvQueue,
java.lang.String amiSessionName,
java.lang.String amiSessionDisplay,
java.lang.String amiSessionHelp,
AmiTraceInterface trace)
Deprecated.
|
AmiSession(java.lang.Object rvTransport,
java.lang.Object rvQueue,
java.lang.String amiSessionName,
java.lang.String amiSessionDisplay,
java.lang.String amiSessionHelp)
Deprecated.
As of Hawk 5.0, instead use AmiSessionFactory to create AmiSession
|
AmiSession(java.lang.Object rvTransport,
java.lang.Object rvQueue,
java.lang.String amiSessionName,
java.lang.String amiSessionDisplay,
java.lang.String amiSessionHelp,
AmiTraceInterface trace)
Deprecated.
As of Hawk 5.0, instead use AmiSessionFactory to create AmiSession
|
AmiSession(java.lang.String service,
java.lang.String network,
java.lang.String daemon,
com.tibco.tibrv.TibrvQueue rvQueue,
java.lang.String amiSessionName,
java.lang.String amiSessionDisplay,
java.lang.String amiSessionHelp)
Deprecated.
|
AmiSession(java.lang.String service,
java.lang.String network,
java.lang.String daemon,
com.tibco.tibrv.TibrvQueue rvQueue,
java.lang.String amiSessionName,
java.lang.String amiSessionDisplay,
java.lang.String amiSessionHelp,
AmiTraceInterface trace)
Deprecated.
|
AmiSession(java.lang.String service,
java.lang.String network,
java.lang.String daemon,
java.lang.Object rvQueue,
java.lang.String amiSessionName,
java.lang.String amiSessionDisplay,
java.lang.String amiSessionHelp)
Deprecated.
As of Hawk 5.0, instead use AmiSessionFactory to create AmiSession
|
AmiSession(java.lang.String service,
java.lang.String network,
java.lang.String daemon,
java.lang.Object rvQueue,
java.lang.String amiSessionName,
java.lang.String amiSessionDisplay,
java.lang.String amiSessionHelp,
AmiTraceInterface trace)
Deprecated.
As of Hawk 5.0, instead use AmiSessionFactory to create AmiSession
|
Modifier and Type | Method and Description |
---|---|
void |
addMethod(AmiMethodInterface method)
Adds the given AmiMethodInterface object to this AmiSession.
|
void |
addMethods(AmiEnabledInterface amiEnabled)
Adds the array of methods defined by the given AmiEnabledInterface object
to this session.
|
void |
announce()
Send the discovery message to the TIB/Hawk Agent
|
void |
createCommonMethods(java.lang.String inName,
java.lang.String inVersion,
java.lang.String inDate,
int inMajorVersion,
int inMinorVersion,
int inUpdateVersion)
This method creates the following common methods for this Session:
getReleaseVersion getTraceLevel setTraceLevel getTraceParameters
|
java.util.Vector |
getAmiThreads() |
boolean |
getAnnounced() |
COM.TIBCO.hawk.ami.AmiMethodContextList |
getAsyncContextList() |
java.lang.String |
getDisplayName()
Returns the display name of this AMI session.
|
java.lang.String |
getHelp()
Returns the help text message of this AMI session.
|
COM.TIBCO.hawk.ami.AmiInvokeQueue |
getInvokeQueue() |
int |
getMaxThreads()
Gets the maximum number of invocation processing thread this
AmiSession is allowed to create.
|
AmiMethodInterface |
getMethod(java.lang.String methodName)
Retrieve the AmiMethodInterface object by its name..
|
COM.TIBCO.hawk.ami.AmiMethodList |
getMethodList() |
AmiMethodInterface[] |
getMethods()
Returns an array of AmiMethodInterfaces for getting and setting AMI
session's number of threads.
|
java.lang.String |
getName()
Returns the name of this AMI session.
|
com.tibco.tibrv.TibrvQueue |
getRvQueue()
Gets the rvQueue of this AMI session.
|
AmiTraceInterface |
getTrace()
Returns the AmiTraceInterface object used to create this AmiSession.
|
COM.TIBCO.hawk.ami.AmiSessionTransport |
getTransport() |
void |
send(java.lang.Object msg)
Send a message.
|
void |
sendData(AmiMethodContext context,
AmiParameterList data)
Sends data to subscriber according to the given method subscription
context.
|
void |
sendError(AmiMethodContext context,
java.lang.String error)
Sends error to subscriber according to the given method subscription
context.
|
void |
sendUnsolicitedMsg(AmiAlertType type,
java.lang.String text,
java.lang.Integer id)
The method sends unsolicited message to TIB/Hawk Agent to be processed by
rulebases via the onUnsolicitedMsg() method.
|
void |
setAnnounced(boolean announced) |
void |
setMaxThreads(int max)
Sets the maximum number of invocation processing thread this
AmiSession is allowed to create. |
void |
setSession(AmiSession ami)
This method has a noop implementation.
|
void |
stop()
The method sends unsolicited message to TIB/Hawk Agent to be processed by
rulebases via the onUnsolicitedMsg() method.
|
public static final int DEFAULT_MAX_THREADS
public static final int MAX_MAX_THREADS
@Deprecated public AmiSession(java.lang.Object rvTransport, java.lang.Object rvQueue, java.lang.String amiSessionName, java.lang.String amiSessionDisplay, java.lang.String amiSessionHelp) throws AmiException
rvTransport
- Transport object.rvQueue
- Queue object.amiSessionName
- Name to uniquely identify this amiSession as a TIB/Hawk
Microagent.amiSessionDisplay
- User-friendly name string for microagent.amiSessionHelp
- Help text for describing the functionalities of this TIB/Hawk
Microagent.AmiException
- thrown if arguments are not valid.@Deprecated public AmiSession(java.lang.Object rvTransport, java.lang.Object rvQueue, java.lang.String amiSessionName, java.lang.String amiSessionDisplay, java.lang.String amiSessionHelp, AmiTraceInterface trace) throws AmiException
rvTransport
- Transport object.rvQueue
- Queue object.amiSessionName
- Name to uniquely identify this amiSession as a TIB/Hawk
Microagent.amiSessionDisplay
- User-friendly name string for microagent.amiSessionHelp
- Help text for describing the functionalities of this TIB/Hawk
Microagent.trace
- An instance of the AmiTraceInterface implementation.AmiException
- rvSession may not be null. amiSessionName may not be null.
amiSessionName may not be an empty string@Deprecated public AmiSession(java.lang.String service, java.lang.String network, java.lang.String daemon, java.lang.Object rvQueue, java.lang.String amiSessionName, java.lang.String amiSessionDisplay, java.lang.String amiSessionHelp) throws AmiException
service
- Rendezvous service.network
- Rendezvous network.daemon
- Rendezvous daemon..rvQueue
- Queue object.amiSessionName
- Name to uniquely identify this amiSession as a TIB/Hawk
Microagent.amiSessionDisplay
- User-friendly name string for microagent.amiSessionHelp
- Help text for describing the functionalities of this TIB/Hawk
Microagent.AmiException
- rvSession may not be null. amiSessionName may not be null.
amiSessionName may not be an empty string@Deprecated public AmiSession(java.lang.String service, java.lang.String network, java.lang.String daemon, java.lang.Object rvQueue, java.lang.String amiSessionName, java.lang.String amiSessionDisplay, java.lang.String amiSessionHelp, AmiTraceInterface trace) throws AmiException
service
- Rendezvous service.network
- Rendezvous network.daemon
- Rendezvous daemon..rvQueue
- Queue object.amiSessionName
- Name to uniquely identify this amiSession as a TIB/Hawk
Microagent.amiSessionDisplay
- User-friendly name string for microagent.amiSessionHelp
- Help text for describing the functionalities of this TIB/Hawk
Microagent.trace
- An instance of the AmiTraceInterface implementation.AmiException
- rvSession may not be null. amiSessionName may not be null.
amiSessionName may not be an empty string@Deprecated public AmiSession(com.tibco.tibrv.TibrvTransport rvTransport, com.tibco.tibrv.TibrvQueue rvQueue, java.lang.String amiSessionName, java.lang.String amiSessionDisplay, java.lang.String amiSessionHelp) throws AmiException
rvTransport
- TibrvTransport object.rvQueue
- TibrvQueue object.amiSessionName
- Name to uniquely identify this amiSession as
a TIB/Hawk Microagent.amiSessionDisplay
- User-friendly name string for microagent.amiSessionHelp
- Help text for describing the functionalities
of this TIB/Hawk Microagent.AmiException
- rvSession may not be null.
amiSessionName may not be null.
amiSessionName may not be an empty string
This constructor will generate a default AmiTrace object which implements the AmiTraceInterface interface.
@Deprecated public AmiSession(com.tibco.tibrv.TibrvTransport rvTransport, com.tibco.tibrv.TibrvQueue rvQueue, java.lang.String amiSessionName, java.lang.String amiSessionDisplay, java.lang.String amiSessionHelp, AmiTraceInterface trace) throws AmiException
rvTransport
- TibrvTransport object.rvQueue
- TibrvQueue object.amiSessionName
- Name to uniquely identify this amiSession as
a TIB/Hawk Microagent.amiSessionDisplay
- User-friendly name string for microagent.amiSessionHelp
- Help text for describing the functionalities
of this TIB/Hawk Microagent.trace
- An instance of the AmiTraceInterface
implementation.AmiException
- rvSession may not be null.
amiSessionName may not be null.
amiSessionName may not be an empty string@Deprecated public AmiSession(java.lang.String service, java.lang.String network, java.lang.String daemon, com.tibco.tibrv.TibrvQueue rvQueue, java.lang.String amiSessionName, java.lang.String amiSessionDisplay, java.lang.String amiSessionHelp) throws AmiException
service
- Rendezvous service.network
- Rendezvous network.daemon
- Rendezvous daemon..rvQueue
- TibrvQueue object.amiSessionName
- Name to uniquely identify this amiSession as
a TIB/Hawk Microagent.amiSessionDisplay
- User-friendly name string for microagent.amiSessionHelp
- Help text for describing the functionalities
of this TIB/Hawk Microagent.AmiException
- rvSession may not be null.
amiSessionName may not be null.
amiSessionName may not be an empty string@Deprecated public AmiSession(java.lang.String service, java.lang.String network, java.lang.String daemon, com.tibco.tibrv.TibrvQueue rvQueue, java.lang.String amiSessionName, java.lang.String amiSessionDisplay, java.lang.String amiSessionHelp, AmiTraceInterface trace) throws AmiException
service
- Rendezvous service.network
- Rendezvous network.daemon
- Rendezvous daemon..rvQueue
- TibrvQueue object.amiSessionName
- Name to uniquely identify this amiSession as
a TIB/Hawk Microagent.amiSessionDisplay
- User-friendly name string for microagent.amiSessionHelp
- Help text for describing the functionalities
of this TIB/Hawk Microagent.trace
- An instance of the AmiTraceInterface
implementation.AmiException
- rvSession may not be null.
amiSessionName may not be null.
amiSessionName may not be an empty stringpublic com.tibco.tibrv.TibrvQueue getRvQueue()
public void send(java.lang.Object msg) throws java.lang.Exception
java.lang.Exception
public java.lang.String getDisplayName()
public void addMethod(AmiMethodInterface method) throws AmiException
method
- The method to be added to this AmiSession.AmiException
- - See below for a complete list of conditions for which
exception is thrown.
An AmiException
is thrown if the given method
has already been added to an AMI session.
An AmiException
is thrown if the application
has already announced this AMI session.
The following method validation checks are performed on
the given AMI method and AmiException
is
thrown if the AMI method does not comply with these rules:
AmiConstants.METHOD_TYPE_INFO
AmiConstants.METHOD_TYPE_ACTION
AmiConstants.METHOD_TYPE_ACTION_INFO
AmiConstants.METHOD_TYPE_INFO
or
AmiConstants.METHOD_TYPE_ACTION_INFO
type,
then its getReturns() method must return a non-null and
non-empty AmiParameterList object.
public void addMethods(AmiEnabledInterface amiEnabled) throws AmiException
amiEnabled
- An object that implments the AmiEnabledInterface interfaceAmiException
- is thrown if one the following condition is true:
This method first invokes the
AmiEnabledInterface.setSession
of the given
AMI enabled object with the current AMI Session. Then the
array of AmiMethodInterface
is obtained
through its AmiEnabledInterface.getMethods
method. This method then adds each
AmiMethodInterface
object to this AMI
session.
AmiMethodInterface validation rules for this method follows those of addMethod(AmiMethodInterface).
public void sendUnsolicitedMsg(AmiAlertType type, java.lang.String text, java.lang.Integer id) throws AmiException
type
- Type of the unsolicited messagetext
- User defined text messageid
- Message idAmiException
- is thrown if in-correct data has been passed or the AMI
object was unable to send message to TIB/Hawk
public void stop() throws AmiException
type
- Type of the unsolicited messagetext
- User defined text messageid
- Message idAmiException
- is thrown if in-correct data has been passed or the AMI
object was unable to send message to TIB/Hawk
public final void sendData(AmiMethodContext context, AmiParameterList data) throws AmiException
context
- The context associated with a particular subscription for
which we are trying to send data to.data
- The data to be published.AmiException
- is thrown if incorrect data is been passed or the the
publication fails.
When data from an AMI asynchronous method becomes available, this method allows the application to publish the data.
public final void sendError(AmiMethodContext context, java.lang.String error) throws AmiException
context
- The context associated with a particular subscription for
which we are trying to send error to.error
- The error text to be published.AmiException
- is thrown if incorrect error is been passed or the the
publication fails.
When AMI asynchronous method encounter an error, this method allows the application to publish the error.
public void announce() throws AmiException
AmiException
- is thrown if this method fails to send the discovery
message.
Note that once the AMI session announces itself, the application should not attempt to add new AMI methods to the session. Attempt to do so will result in exception being raised.
public java.lang.String getName()
public java.lang.String getHelp()
public AmiTraceInterface getTrace()
public AmiMethodInterface getMethod(java.lang.String methodName) throws AmiException
methodName
- Name of the method name to lookupAmiException
- is thrown if methodName is nullpublic int getMaxThreads()
public void setMaxThreads(int max) throws AmiException
AmiSession
is allowed to create.max
- the maximum number of invocation processing threadAmiException
- is thrown if the given max value is less than one (1) or
greater than MAX_MAX_THREADS
public AmiMethodInterface[] getMethods() throws AmiException
getMethods
in interface AmiEnabledInterface
This method implements the AmiEnabledInterface such that an array of two AmiMethodInterfaces for getting and setting the number of AMI invocation processing threads are returned.
The AmiMethodInterfaces returned by this method are:
getMaxThreads
setMaxThreads
AmiException
public void setSession(AmiSession ami) throws AmiException
setSession
in interface AmiEnabledInterface
ami
- The current AmiSession objectAmiException
public void createCommonMethods(java.lang.String inName, java.lang.String inVersion, java.lang.String inDate, int inMajorVersion, int inMinorVersion, int inUpdateVersion) throws AmiException
inName
- Release version name of applicationinVersion
- Release version of applicationinDate
- Release version date of applicationinMajorVersion
- Major versioninMinorVersion
- Minor versioninUpdateVersion
- Update versionAmiException
public COM.TIBCO.hawk.ami.AmiInvokeQueue getInvokeQueue()
public COM.TIBCO.hawk.ami.AmiMethodList getMethodList()
public COM.TIBCO.hawk.ami.AmiMethodContextList getAsyncContextList()
public boolean getAnnounced()
public void setAnnounced(boolean announced)
public COM.TIBCO.hawk.ami.AmiSessionTransport getTransport()
public java.util.Vector getAmiThreads()
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.