org.jboss.mq.pm
Class Tx

java.lang.Object
  extended byorg.jboss.mq.pm.Tx
All Implemented Interfaces:
java.lang.Comparable, java.io.Externalizable, java.io.Serializable

public class Tx
extends java.lang.Object
implements java.lang.Comparable, java.io.Externalizable

A transaction

See Also:
Serialized Form

Constructor Summary
Tx()
          Create a new Tx for externailzation
Tx(long value)
          Create a new Tx
 
Method Summary
 void addPostRollbackTask(java.lang.Runnable task)
          Add post rollback task
 boolean checkPersisted()
          Get whether the transaction has been persisted
 int compareTo(java.lang.Object o)
           
 int compareTo(Tx (src)  anotherLong)
          Compare
 int hashCode()
           
 long longValue()
          Get the long value
 void readExternal(java.io.ObjectInput in)
           
 void rollback(PersistenceManager (src)  pm)
          Commit the transaction
 void setValue(long tx)
          Set the value
 java.lang.String toString()
           
 boolean wasPersisted()
          Get whether the transaction has been persisted
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tx

public Tx()
Create a new Tx for externailzation


Tx

public Tx(long value)
Create a new Tx

Parameters:
value - the value
Method Detail

setValue

public void setValue(long tx)
Set the value

Parameters:
tx - the new value

longValue

public long longValue()
Get the long value

Returns:
the long value

checkPersisted

public boolean checkPersisted()
Get whether the transaction has been persisted

Returns:
true when persisted

wasPersisted

public boolean wasPersisted()
Get whether the transaction has been persisted

Returns:
true when persisted

compareTo

public int compareTo(Tx (src)  anotherLong)
Compare

Parameters:
anotherLong - the other value
Returns:
-1, 0, 1 if less than, equal or greater than respectively

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException

writeExternal

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

toString

public java.lang.String toString()

hashCode

public int hashCode()

rollback

public void rollback(PersistenceManager (src)  pm)
              throws JMSException (src) 
Commit the transaction

Parameters:
pm - the persistence manager
Throws:
JMSExecption - for any error
JMSException (src)

addPostRollbackTask

public void addPostRollbackTask(java.lang.Runnable task)
                         throws JMSException (src) 
Add post rollback task

Parameters:
task - the task
Throws:
JMSExecption - for any error
JMSException (src)