Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.atomikos.icatch.msg
Class AbstractMessage

    java.lang.Object
      com.atomikos.icatch.msg.AbstractMessage

All Implemented Interfaces:
  TransactionMessage

Direct Known Subclasses:
  CommitMessageImp, ErrorMessageImp, ForgetMessageImp, PreparedMessageImp, PrepareMessageImp, RegisteredMessageImp, RegisterMessageImp, ReplayMessageImp, RollbackMessageImp, StateMessageImp

    public abstract class AbstractMessage

extends Object
implements TransactionMessage

Copyright © 2002-2009, Atomikos. All rights reserved. A base implementation of all message classes.

Field Summary

Fields inherited from interface com.atomikos.icatch.msg.TransactionMessage
`COMMIT_MESSAGE, ERROR_MESSAGE, FORGET_MESSAGE, FORMAT_SOAP, FORMAT_UNKNOWN, PREPARE_MESSAGE, PREPARED_MESSAGE, REGISTER_MESSAGE, REGISTERED_MESSAGE, REPLAY_MESSAGE, ROLLBACK_MESSAGE, STATE_MESSAGE`

Constructor Summary
`AbstractMessage(int protocol, int format, Object targetAddress, String targetURI, Object senderAddress, String senderURI)` Create a new instance.

Method Summary
`int` | `getFormat()` Get the format identifier.
`int` | `getProtocol()` Get the protocol identifier.
`Object` | `getSenderAddress()` Get the sender address for the message.
`String` | `getSenderURI()` Get the sender URI for the message.
`Object` | `getTargetAddress()` Get the destination address of the message.
`String` | `getTargetURI()` Get the URI of the target object of the message.
`String` | `toString()`

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

Methods inherited from interface com.atomikos.icatch.msg.TransactionMessage
`getMessageType`

Constructor Detail

### AbstractMessage

    public AbstractMessage(int protocol,
                           int format,
                           Object targetAddress,
                           String targetURI,
                           Object senderAddress,
                           String senderURI)

  Create a new instance.

  Parameters:
    `protocol` - The commit protocol.
    `format` - The format of the message.
    `targetAddress` - Where to send it.
    `targetURI` - For which target object this is.
    `senderAddress` - Who is sending this.
    `senderURI` - Which object is sending this.

Method Detail

### getProtocol

    public int getProtocol()

  Description copied from interface: `TransactionMessage`
  Get the protocol identifier.

  Specified by:
    `getProtocol` in interface `TransactionMessage`
  Returns:
    int One of the CommitProtocol values.
  See Also:
    `TransactionMessage`

### getFormat

    public int getFormat()

  Description copied from interface: `TransactionMessage`
  Get the format identifier.

  Specified by:
    `getFormat` in interface `TransactionMessage`
  Returns:
    int One of the FORMAT_* values.
  See Also:
    `TransactionMessage`

### getTargetAddress

    public Object getTargetAddress()

  Description copied from interface: `TransactionMessage`
  Get the destination address of the message. The target address is opaque to the messaging package; its concrete content is only known by the protocol-specific wire-level code. The messaging package calls this method when processing a registration message: whereas the senderAddress indicates where to reply to, the targetAddress is expected to be the contact address information (to be used by two-phase commit) for reaching the remote participant that is registering.

  Specified by:
    `getTargetAddress` in interface `TransactionMessage`
  Returns:
    Object The destination address.
  See Also:
    `TransactionMessage`

### getTargetURI

    public String getTargetURI()

  Description copied from interface: `TransactionMessage`
  Get the URI of the target object of the message. This value is closely related to the senderURI.

  Specified by:
    `getTargetURI` in interface `TransactionMessage`
  Returns:
    String The globally unique target object URI.
  See Also:
    `TransactionMessage`

### getSenderAddress

    public Object getSenderAddress()

  Description copied from interface: `TransactionMessage`
  Get the sender address for the message. The sender address is opaque to the messaging package; its concrete content is only known by the protocol-specific wire-level code. The messaging code ensures, however, that all reply messages (created for incoming two-phase request messages) have a targetAddress corresponding to the senderAddress of the request.

  Specified by:
    `getSenderAddress` in interface `TransactionMessage`
  Returns:
    The sender address.
  See Also:
    `TransactionMessage`

### getSenderURI

    public String getSenderURI()

  Description copied from interface: `TransactionMessage`
  Get the sender URI for the message. The senderURI is assumed to uniquely identify the sending transaction object for a request or reply message. The senderURI is related to the targetURI in the 2-phase commit conversations:
  - For outgoing 2PC requests, senderURI and targetURI are the same and correspond to the URI of the remote participant.
  - For incoming 2PC replies, the targetURI should be the same as the senderURI of the original request, or the messaging code in this package will not work.
  - For incoming 2PC requests, the targetURI should be the URI of a local participant. The senderURI is opaque and used only for setting the right correlation info as the targetURI of the reply.
  - For outgoing 2PC replies (including registration confirmation), the senderURI corresponds to the original targetURI found in the incoming request message and the targetURI is the senderURI of the incoming request message.
  - For outgoing replay requests, the senderURI is the URI of the local participant requesting the replay.
  - For incoming registration requests, the senderURI represents the remote participant's URI to use in this transaction service when sending commit requests.
  - For outgoing registration requests, the senderURI is an URI combined of the local participant plus the URL of the local registration requesting port.

  Specified by:
    `getSenderURI` in interface `TransactionMessage`
  Returns:
    String The globally unique sender URI.
  See Also:
    `TransactionMessage`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012. All Rights Reserved.