com.atomikos.icatch.msg
Class PrepareMessageImp

java.lang.Object
  extended by com.atomikos.icatch.msg.AbstractMessage
      extended by com.atomikos.icatch.msg.PrepareMessageImp
All Implemented Interfaces:
PrepareMessage, TransactionMessage

public class PrepareMessageImp
extends AbstractMessage
implements PrepareMessage

A reusable prepare message implementation.


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
PrepareMessageImp(int protocol, int format, Object targetAddress, String targetURI, Object senderAddress, String senderURI)
          Create a new instance.
PrepareMessageImp(int protocol, int format, Object targetAddress, String targetURI, Object senderAddress, String senderURI, int globalSiblingCount, CascadeInfo[] cascadeInfo)
          Create a new instance.
 
Method Summary
 CascadeInfo[] getCascadeInfo()
          Get the orphan detection information to cascade.
 int getGlobalSiblingCount()
          Get the globally detected no of invocations for the target participant.
 int getMessageType()
          Get the message type.
 boolean hasOrphanInfo()
          Check if the message is carrying information for orphan detection.
 String toString()
           
 
Methods inherited from class com.atomikos.icatch.msg.AbstractMessage
getFormat, getProtocol, getSenderAddress, getSenderURI, getTargetAddress, getTargetURI
 
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
getFormat, getProtocol, getSenderAddress, getSenderURI, getTargetAddress, getTargetURI
 

Constructor Detail

PrepareMessageImp

public PrepareMessageImp(int protocol,
                         int format,
                         Object targetAddress,
                         String targetURI,
                         Object senderAddress,
                         String senderURI)
Create a new instance. If this constructor is used, orphan info will not be present.

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.

PrepareMessageImp

public PrepareMessageImp(int protocol,
                         int format,
                         Object targetAddress,
                         String targetURI,
                         Object senderAddress,
                         String senderURI,
                         int globalSiblingCount,
                         CascadeInfo[] cascadeInfo)
Create a new instance. If this constructor is used, orphan info will be present.

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.
globalSiblingCount - The global count.
cascadeInfo - The info for orphan detection.
Method Detail

hasOrphanInfo

public boolean hasOrphanInfo()
Description copied from interface: PrepareMessage
Check if the message is carrying information for orphan detection.

Specified by:
hasOrphanInfo in interface PrepareMessage
Returns:
boolean True iff the message has info concerning orphan detection.
See Also:
PrepareMessage

getGlobalSiblingCount

public int getGlobalSiblingCount()
Description copied from interface: PrepareMessage
Get the globally detected no of invocations for the target participant. This method should only be called if hasOrphanInfo returns true.

Specified by:
getGlobalSiblingCount in interface PrepareMessage
Returns:
int The globally detected no of invocations for the target participant.
See Also:
PrepareMessage

getCascadeInfo

public CascadeInfo[] getCascadeInfo()
Description copied from interface: PrepareMessage
Get the orphan detection information to cascade. This method should only be called if hasOrphanInfo returns true.

Specified by:
getCascadeInfo in interface PrepareMessage
Returns:
CascadeInfo[] The cascade info.
See Also:
PrepareMessage

getMessageType

public int getMessageType()
Description copied from interface: TransactionMessage
Get the message type.

Specified by:
getMessageType in interface TransactionMessage
Returns:
int One of the predefined types.
See Also:
TransactionMessage

toString

public String toString()
Overrides:
toString in class AbstractMessage


Copyright © 2012. All Rights Reserved.