com.atomikos.icatch.msg
Class AbstractMessage

java.lang.Object
  extended by 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

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:

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


Copyright © 2012. All Rights Reserved.