cuba.wired
Class AllocationManager

java.lang.Object
  extended by cuba.wired.AllocationManager
All Implemented Interfaces:
javax.transaction.TransactionManager

public class AllocationManager
extends java.lang.Object
implements javax.transaction.TransactionManager

An allocation manager is instantiated as a ThreadLocal in the WiredContainer to collect all resources and transactions being used along a call chain.

Author:
Jan Lessner

Constructor Summary
AllocationManager()
           
 
Method Summary
 void begin()
           
 void commit()
           
 int getStatus()
          javax.transaction.TransactionManager
 javax.transaction.Transaction getTransaction()
           
 void resume(javax.transaction.Transaction tx)
           
 void rollback()
           
 void setRollbackOnly()
          Forwards a vote-for-rollback to the current WiredTransactionI if there is any.
 void setTransactionTimeout(int arg0)
           
 javax.transaction.Transaction suspend()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllocationManager

public AllocationManager()
Method Detail

setRollbackOnly

public void setRollbackOnly()
                     throws javax.transaction.SystemException
Forwards a vote-for-rollback to the current WiredTransactionI if there is any.

Specified by:
setRollbackOnly in interface javax.transaction.TransactionManager
Throws:
javax.transaction.SystemException

getStatus

public int getStatus()
              throws javax.transaction.SystemException
javax.transaction.TransactionManager

Specified by:
getStatus in interface javax.transaction.TransactionManager
Throws:
javax.transaction.SystemException

begin

public void begin()
           throws javax.transaction.NotSupportedException,
                  javax.transaction.SystemException
Specified by:
begin in interface javax.transaction.TransactionManager
Throws:
javax.transaction.NotSupportedException
javax.transaction.SystemException

commit

public void commit()
            throws javax.transaction.SystemException
Specified by:
commit in interface javax.transaction.TransactionManager
Throws:
javax.transaction.SystemException

rollback

public void rollback()
              throws javax.transaction.SystemException
Specified by:
rollback in interface javax.transaction.TransactionManager
Throws:
javax.transaction.SystemException

setTransactionTimeout

public void setTransactionTimeout(int arg0)
                           throws javax.transaction.SystemException
Specified by:
setTransactionTimeout in interface javax.transaction.TransactionManager
Throws:
javax.transaction.SystemException

getTransaction

public javax.transaction.Transaction getTransaction()
                                             throws javax.transaction.SystemException
Specified by:
getTransaction in interface javax.transaction.TransactionManager
Throws:
javax.transaction.SystemException

suspend

public javax.transaction.Transaction suspend()
                                      throws javax.transaction.SystemException
Specified by:
suspend in interface javax.transaction.TransactionManager
Throws:
javax.transaction.SystemException

resume

public void resume(javax.transaction.Transaction tx)
            throws javax.transaction.InvalidTransactionException,
                   java.lang.IllegalStateException,
                   javax.transaction.SystemException
Specified by:
resume in interface javax.transaction.TransactionManager
Throws:
javax.transaction.InvalidTransactionException
java.lang.IllegalStateException
javax.transaction.SystemException