|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.conversation.AbleJasMessageSystemAdapter
The AbleJasMessageSystemAdapter class is a MessageSystemAdapter that uses Java Agent Services (JAS) messaging.
It also contains a reference to an AbleBean--its putative owner--which it uses for logging and trace-logging.
In order for this MessageSystemAdapter to work, it must be initialized with a working JAS transport service.
MessageTransportService
Field Summary | |
---|---|
static java.lang.String |
RECEIVER_CONVERSATION_ID_KEY
Key under which the sender of a message stores the recipient's conversation ID in the message's header. |
static java.lang.String |
SENDER_CONVERSATION_ID_KEY
Key under which the sender of a message stores its own conversation ID in the message's header. |
Constructor Summary | |
---|---|
AbleJasMessageSystemAdapter()
Constructs an AbleJasMessageSystemAdapter with null instance variables. |
|
AbleJasMessageSystemAdapter(AbleBean newOwner)
Constructs an AbleJasMessageSystemAdapter with the given bean as owner. |
|
AbleJasMessageSystemAdapter(AbleBean newOwner,
javax.agent.service.transport.MessageTransportService newTransport)
Constructs an AbleJasMessageSystemAdapter. |
Method Summary | |
---|---|
MessageHandle |
createMessage()
Creates and returns an instance of a message of the type that can be delivered by this MessageSystemAdapter. |
protected javax.agent.TransportMessage |
createTransportMessage(ConversationMetaData metaData,
MessageHandle mh)
Creates a TransportMessage out of the given MetaData and MessageHandle. |
javax.agent.service.transport.MessageTransportService |
getTransportService()
Returns the MessageTransportService used in delivering messages. |
protected void |
initEnvelope(JasConversationMetaData jasMetaData,
org.jagent.acr.AcrEnvelope envelope)
Initializes a message's envelope. |
protected void |
logException(java.lang.String theMethodName,
java.lang.Exception theException)
Logs an exception with the AbleBean that "owns" this MessageSystemAdapter. |
static MessageHandle |
makeMessageHandle(javax.agent.TransportMessage msg)
Converts a TransportMessage (created by the JAS subsystem) into a MessageHandle. |
static java.lang.String |
parseConversationId(javax.agent.TransportMessage msg)
Extracts the recipient's conversation ID from the given message's header. |
void |
sendMessage(Conversation conv,
MessageHandle mh)
Undertakes to deliver the given message. |
void |
setLogOwner(AbleBean newOwner)
Sets the AbleBean that "owns" this MessageSystemAdapter--i.e., the bean to use for logging and trace-logging. |
void |
setTransportService(javax.agent.service.transport.MessageTransportService svc)
Sets the MessageTransportService used in delivering messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SENDER_CONVERSATION_ID_KEY
public static final java.lang.String RECEIVER_CONVERSATION_ID_KEY
Constructor Detail |
public AbleJasMessageSystemAdapter()
null
instance variables.
The transport service must be set (via setTransportService()
) before this
MessageSystemAdapter can be used.
public AbleJasMessageSystemAdapter(AbleBean newOwner)
The transport service must be set (via setTransportService()
) before this
MessageSystemAdapter can be used.
newOwner
- The AbleBean that "owns" this MessageSystemAdapter.public AbleJasMessageSystemAdapter(AbleBean newOwner, javax.agent.service.transport.MessageTransportService newTransport)
newOwner
- The AbleBean that "owns" this MessageSystemAdapter.newTransport
- The MessageTransportService to use in delivering messages.Method Detail |
public javax.agent.service.transport.MessageTransportService getTransportService()
public void setTransportService(javax.agent.service.transport.MessageTransportService svc)
svc
- The MessageTransportService to use in delivering messages.public void setLogOwner(AbleBean newOwner)
newOwner
- The bean that "owns" this MessageSystemAdapter.public static java.lang.String parseConversationId(javax.agent.TransportMessage msg)
TransportMessage
- msg the message from which to extract the conversation id.public static MessageHandle makeMessageHandle(javax.agent.TransportMessage msg)
For JAS-based messaging, the MessageHandle contains the payload. So this extracts the payload and copies it into the MessageHandle.
msg
- The TransportMessage to be converted.public MessageHandle createMessage()
MessageSystemAdapter
createMessage
in interface MessageSystemAdapter
com.ibm.conversation.MessageSystemAdapter
public void sendMessage(Conversation conv, MessageHandle mh)
MessageSystemAdapter
sendMessage
in interface MessageSystemAdapter
com.ibm.conversation.MessageSystemAdapter
conv
- The Conversation associated with this message.mh
- The message to be delivered.protected javax.agent.TransportMessage createTransportMessage(ConversationMetaData metaData, MessageHandle mh)
In JAS-based messaging, the MessageHandle contains a Payload. So this creates a new TransportMessage and puts the Payload into it. Also initializes the message envelope, so that the TransportMessage is ready for delivery..
metaData
- The ConversationMetaData for the conversation this message is a part of.mh
- The message to convert into a TransportMessageprotected void initEnvelope(JasConversationMetaData jasMetaData, org.jagent.acr.AcrEnvelope envelope)
Called by createTransportMessage()
.
Fills in the message's header: Adds sender & recipient conversation IDs, locators
and names.
protected void logException(java.lang.String theMethodName, java.lang.Exception theException)
If the owner is null
, does nothing.
theMethodName
- The name of the method in which the exception occurred.theException
- The exception to log.
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |