com.sun.enterprise.transaction
Class TransactionManagerHelper

java.lang.Object
  extended by com.sun.enterprise.transaction.TransactionManagerHelper
All Implemented Interfaces:
TransactionImport, TransactionManager

@Service
public class TransactionManagerHelper
extends java.lang.Object
implements TransactionManager, TransactionImport

This class is wrapper for the actual transaction manager implementation. JNDI lookup name "java:appserver/TransactionManager" see the com/sun/enterprise/naming/java/javaURLContext.java


Constructor Summary
TransactionManagerHelper()
           
 
Method Summary
 void begin()
           
 void commit()
           
 int getStatus()
           
 Transaction getTransaction()
           
 int getTransactionRemainingTimeout()
          Return duration before current transaction would timeout.
 XATerminator getXATerminator()
           
 void postInvokeTx(boolean suspend, boolean checkServletInvocation)
          PostInvoke Transaction configuration for Servlet Container.
 void preInvokeTx(boolean checkServletInvocation)
          PreInvoke Transaction configuration for Servlet Container.
 void recreate(Xid xid, long timeout)
           
 void registerRecoveryResourceHandler(XAResource xaResource)
          
 void release(Xid xid)
           
 void resume(Transaction tobj)
           
 void rollback()
           
 void setRollbackOnly()
           
 void setTransactionTimeout(int seconds)
           
 Transaction suspend()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionManagerHelper

public TransactionManagerHelper()
Method Detail

begin

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

commit

public void commit()
            throws RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   java.lang.SecurityException,
                   java.lang.IllegalStateException,
                   SystemException
Specified by:
commit in interface TransactionManager
Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
java.lang.SecurityException
java.lang.IllegalStateException
SystemException

getStatus

public int getStatus()
              throws SystemException
Specified by:
getStatus in interface TransactionManager
Throws:
SystemException

getTransaction

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

resume

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

rollback

public void rollback()
              throws java.lang.IllegalStateException,
                     java.lang.SecurityException,
                     SystemException
Specified by:
rollback in interface TransactionManager
Throws:
java.lang.IllegalStateException
java.lang.SecurityException
SystemException

setRollbackOnly

public void setRollbackOnly()
                     throws java.lang.IllegalStateException,
                            SystemException
Specified by:
setRollbackOnly in interface TransactionManager
Throws:
java.lang.IllegalStateException
SystemException

setTransactionTimeout

public void setTransactionTimeout(int seconds)
                           throws SystemException
Specified by:
setTransactionTimeout in interface TransactionManager
Throws:
SystemException

suspend

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

recreate

public void recreate(Xid xid,
                     long timeout)
Specified by:
recreate in interface TransactionImport

release

public void release(Xid xid)
Specified by:
release in interface TransactionImport

getXATerminator

public XATerminator getXATerminator()
Specified by:
getXATerminator in interface TransactionImport

preInvokeTx

public void preInvokeTx(boolean checkServletInvocation)
PreInvoke Transaction configuration for Servlet Container. BaseContainer.preInvokeTx() handles all this for CMT EJB. Compensate that JavaEEInstanceListener.handleBeforeEvent( BEFORE_SERVICE_EVENT) gets called before WSIT WSTX Service pipe associates a JTA txn with incoming thread. Precondition: assumes JTA transaction already associated with current thread.


postInvokeTx

public void postInvokeTx(boolean suspend,
                         boolean checkServletInvocation)
PostInvoke Transaction configuration for Servlet Container. BaseContainer.preInvokeTx() handles all this for CMT EJB. Precondition: assumed called prior to current transcation being suspended or released.

Parameters:
suspend - indicate whether the delisting is due to suspension or transaction completion(commmit/rollback)

getTransactionRemainingTimeout

public int getTransactionRemainingTimeout()
                                   throws SystemException
Return duration before current transaction would timeout.

Specified by:
getTransactionRemainingTimeout in interface TransactionImport
Returns:
Returns the duration in seconds before current transaction would timeout. Returns zero if transaction has no timeout set and returns negative value if transaction already timed out.
Throws:
java.lang.IllegalStateException - Thrown if the current thread is not associated with a transaction.
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

registerRecoveryResourceHandler

public void registerRecoveryResourceHandler(XAResource xaResource)

Specified by:
registerRecoveryResourceHandler in interface TransactionImport


Copyright © 2012 GlassFish Community. All Rights Reserved.