|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.platform.AbleJasMessageListener
This class provides a simple JAS message listener, or message
"inbox", for all AblePlatformDefaultAgent objects; each
AblePlatformDefaultAgent has at least one of these listeners,
which, by default, is setup by the agent to call back to the
containing agent's receiveMessage(TransportMessage)
method. Each AbleJasMessageListener created by an agent should be
coupled with a JAS Locator which is advertised in the agent's
registered AgentDescription. This allows other agents to examine
the number and kind of inboxes an agent has and then send certain
types of messages to specific inboxes.
By extending this class, a listener can be made to deal with incoming messages itself rather than calling back to the containing agent; or, a derived listener can be made to route messages of different types to different entry points within the containing agent, thus providing an agent with the ability to have multiple inboxes instead of just one, as seems to be the norm in JAS.
| Field Summary | |
|---|---|
protected AblePlatformDefaultAgent |
myParent
The AblePlatformDefaultAgent that owns this JAS message listener, or "inbox". |
protected AbleUserDefinedFunction |
myParentsMessageReceiveMethod
The method in the containing agent that is called by this listener when an incoming JAS message is received. |
protected java.lang.String |
myProtocol
The message protocol that is used by this inbox; by default, this is an empty string as message protocols have no meaning for base AblePlatformDefaultAgent objects. |
| Constructor Summary | |
|---|---|
AbleJasMessageListener(AblePlatformDefaultAgent theParent,
java.lang.String theProtocol,
AbleUserDefinedFunction theParentsMessageReceiveMethod)
Creates a new Able JAS MessageListener, or "inbox", for an AblePlatformDefaultAgent. |
|
| Method Summary | |
|---|---|
java.lang.String |
getProtocol()
Gets the message protocol used by this message listener. |
void |
receiveMessage(javax.agent.TransportMessage theTransportMessage)
When a JAS message receiver receives a transport message on a Locator associated with this inbox, the JAS message receiver calls this method; in this default implementation, the transport message is simply forwarded on to the specified method in this message listener's containing agent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.agent.service.transport.MessageListener |
|---|
equals, hashCode |
| Field Detail |
protected AblePlatformDefaultAgent myParent
protected java.lang.String myProtocol
protected AbleUserDefinedFunction myParentsMessageReceiveMethod
| Constructor Detail |
public AbleJasMessageListener(AblePlatformDefaultAgent theParent,
java.lang.String theProtocol,
AbleUserDefinedFunction theParentsMessageReceiveMethod)
theParent - the AblePlatformDefaultAgent that owns this "inbox".
theProtocol - the message protocol that this inbox is to use. The
empty string means no specific protocol. This base
message listener simply saves this parameter, but does
not use it.
theParentsMessageReceiveMethod - the method within the containing agent that this inbox
is to call when a JAS message is received.
| Method Detail |
public void receiveMessage(javax.agent.TransportMessage theTransportMessage)
receiveMessage in interface javax.agent.service.transport.MessageListenertheTransportMessage - the incoming message.
public java.lang.String getProtocol()
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||