org.exolab.jms.tranlog
Class TransactionState

java.lang.Object
  |
  +--org.exolab.jms.tranlog.TransactionState
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public final class TransactionState
extends java.lang.Object
implements java.io.Externalizable

This class defines the various states of a transaction that a ResourceManager participates in.. Opened transaction is in an open state Prepared transaction is in a prepared state Closed transaction is in a closed state

Version:
$Revision: 1.1 $ $Date: 2004/11/26 01:51:01 $
Author:
Jim Alateras
See Also:
Serialized Form

Field Summary
static TransactionState CLOSED
           
static int CLOSED_ORD
           
static TransactionState OPENED
          Instatiate instances related to each of the enumerations.
static int OPENED_ORD
          The public ordinal values for each of the enumerates states
static TransactionState PREPARED
           
static int PREPARED_ORD
           
 
Constructor Summary
TransactionState()
          Default constructor for Serialization
 
Method Summary
 boolean equals(java.lang.Object obj)
          Return true iff the two specified object are of the same type and their ordinal values are identical.
 int getOrd()
          Returns the ordinal value for this state
 boolean isClosed()
          Check if the transaction state is set to closed
 boolean isOpened()
          Check if the transaction state is set to opened
 boolean isPrepared()
          Check if the transaction state is set to prepared
 void readExternal(java.io.ObjectInput stream)
           
 java.lang.String toString()
          Returns the name of this state
 void writeExternal(java.io.ObjectOutput stream)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPENED_ORD

public static final int OPENED_ORD
The public ordinal values for each of the enumerates states

PREPARED_ORD

public static final int PREPARED_ORD

CLOSED_ORD

public static final int CLOSED_ORD

OPENED

public static final TransactionState OPENED
Instatiate instances related to each of the enumerations. New enumerations must be added to the end

PREPARED

public static final TransactionState PREPARED

CLOSED

public static final TransactionState CLOSED
Constructor Detail

TransactionState

public TransactionState()
Default constructor for Serialization
Method Detail

getOrd

public int getOrd()
Returns the ordinal value for this state
Returns:
int

toString

public java.lang.String toString()
Returns the name of this state
Overrides:
toString in class java.lang.Object
Returns:
String

equals

public boolean equals(java.lang.Object obj)
Return true iff the two specified object are of the same type and their ordinal values are identical.
Overrides:
equals in class java.lang.Object
Parameters:
obj - object to compare against
Returns:
boolean true if objects are equivalent

isOpened

public boolean isOpened()
Check if the transaction state is set to opened
Returns:
boolean - ture if it is

isPrepared

public boolean isPrepared()
Check if the transaction state is set to prepared
Returns:
boolean - ture if it is

isClosed

public boolean isClosed()
Check if the transaction state is set to closed
Returns:
boolean - ture if it is

writeExternal

public void writeExternal(java.io.ObjectOutput stream)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable

readExternal

public void readExternal(java.io.ObjectInput stream)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.