Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| 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

## com.ibm.able.conversation
Class AblePlatformMessageSystemAdapter

    java.lang.Object
      com.ibm.able.conversation.AbleOwned
          com.ibm.able.conversation.AblePlatformMessageSystemAdapter

All Implemented Interfaces:
  MessageSystemAdapter

public class AblePlatformMessageSystemAdapter
extends AbleOwned
implements MessageSystemAdapter

The AblePlatformMessageSystemAdapter 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.

See Also:
  `MessageTransportService`

Field Summary
`static java.lang.String` | `RECIPIENT_CONVERSATION_ID` 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 under which the sender of a message stores its own conversation ID in the message's header.

Constructor Summary
`AblePlatformMessageSystemAdapter()` Constructs an AbleJasMessageSystemAdapter with `null` instance variables.
`AblePlatformMessageSystemAdapter(AbleBean newOwner)` Constructs an AbleJasMessageSystemAdapter with the given bean as owner.
`AblePlatformMessageSystemAdapter(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(com.ibm.conversation.jas.JasConversationMetaData jasMetaData, org.jagent.acr.AcrEnvelope envelope)` Initializes a message's envelope.
`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` | `setTransportService(javax.agent.service.transport.MessageTransportService svc)` Sets the MessageTransportService used in delivering messages.

Methods inherited from class com.ibm.able.conversation.AbleOwned
`getAbleOwner, logException, logMessage, setAbleOwner`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SENDER_CONVERSATION_ID

    public static final java.lang.String SENDER_CONVERSATION_ID

  Key under which the sender of a message stores its own conversation ID in the message's header.

  See Also:
    Constant Field Values

### RECIPIENT_CONVERSATION_ID

    public static final java.lang.String RECIPIENT_CONVERSATION_ID

  Key under which the sender of a message stores the recipient's conversation ID in the message's header.

  See Also:
    Constant Field Values

Constructor Detail

### AblePlatformMessageSystemAdapter

    public AblePlatformMessageSystemAdapter()

  Constructs an AbleJasMessageSystemAdapter with `null` instance variables.

  The transport service must be set (via `setTransportService()`) before this MessageSystemAdapter can be used.

### AblePlatformMessageSystemAdapter

    public AblePlatformMessageSystemAdapter(AbleBean newOwner)

  Constructs an AbleJasMessageSystemAdapter with the given bean as owner.

  The transport service must be set (via `setTransportService()`) before this MessageSystemAdapter can be used.

Parameters:
  `newOwner` - The AbleBean that "owns" this MessageSystemAdapter.

### AblePlatformMessageSystemAdapter

    public AblePlatformMessageSystemAdapter(AbleBean newOwner,
                                            javax.agent.service.transport.MessageTransportService newTransport)

  Constructs an AbleJasMessageSystemAdapter.

Parameters:
  `newOwner` - The AbleBean that "owns" this MessageSystemAdapter.
  `newTransport` - The MessageTransportService to use in delivering messages.

Method Detail

### getTransportService

    public javax.agent.service.transport.MessageTransportService getTransportService()

  Returns the MessageTransportService used in delivering messages.

  Returns:
    The MessageTransportService used in delivering messages.

### setTransportService

    public void setTransportService(javax.agent.service.transport.MessageTransportService svc)

  Sets the MessageTransportService used in delivering messages.

  Parameters:
    `svc` - The MessageTransportService to use in delivering messages.

### parseConversationId

    public static java.lang.String parseConversationId(javax.agent.TransportMessage msg)

  Extracts the recipient's conversation ID from the given message's header.

  Parameters:
    `msg` - the message from which to extract the conversation id.
  Returns:
    The recipient's conversation ID, or null if none found.

### makeMessageHandle

    public static MessageHandle makeMessageHandle(javax.agent.TransportMessage msg)

  Converts a TransportMessage (created by the JAS subsystem) into a MessageHandle.

  For JAS-based messaging, the MessageHandle contains the payload. So this extracts the payload and copies it into the MessageHandle.

  Parameters:
    `msg` - The TransportMessage to be converted.
  Returns:
    The MessageHandle into which the message was converted.

### createMessage

    public MessageHandle createMessage()

  Description copied from interface: `MessageSystemAdapter`
  Creates and returns an instance of a message of the type that can be delivered by this MessageSystemAdapter. The message's contents are not filled in.

  Specified by:
    `createMessage` in interface `MessageSystemAdapter`
  Returns:
    A MessageHandle contaioning the newly created message.

### sendMessage

    public void sendMessage(Conversation conv,
                            MessageHandle mh)

  Description copied from interface: `MessageSystemAdapter`
  Undertakes to deliver the given message.

  Specified by:
    `sendMessage` in interface `MessageSystemAdapter`
  Parameters:
    `conv` - The Conversation associated with this message.
    `mh` - The message to be delivered.

### createTransportMessage

    protected javax.agent.TransportMessage createTransportMessage(ConversationMetaData metaData,
                                                                  MessageHandle mh)

  Creates a TransportMessage out of the given MetaData and MessageHandle.

  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..

  Parameters:
    `metaData` - The ConversationMetaData for the conversation this message is a part of.
    `mh` - The message to convert into a TransportMessage
  Returns:
    The TransportMessage converted from the input args, ready for delivery.

### initEnvelope

    protected void initEnvelope(com.ibm.conversation.jas.JasConversationMetaData jasMetaData,
                                org.jagent.acr.AcrEnvelope envelope)

  Initializes a message's envelope.

  Called by `createTransportMessage()`. Fills in the message's header: Adds sender & recipient conversation IDs, locators and names.

  Parameters:
    `jasMetaData` - The conversation meta-data containing the info to put into the envelope.
    `envelope` - The envelope to initialize.

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| 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

(C) Copyright IBM Corporation 1999, 2005