FileDocCategorySizeDatePackage
TransactionImportManager.javaAPI DocExample5867Tue May 29 16:57:16 BST 2007com.sun.xml.ws.tx.common

TransactionImportManager

public class TransactionImportManager extends Object implements com.sun.enterprise.transaction.TransactionImport
Access Transaction Inflow Contract from Java Connector 1.5 API. Assumption is the underlying TransactionManager is implementing this interface. Separate this from TransactionManagerImpl since this provides mostly service side assistance. Assists in supporting application client and standalone client to separate from more commonly used methods in TransactionManagerImpl.

Fields Summary
private static final TxLogger
logger
static final com.sun.enterprise.transaction.TransactionImport
instance
private static com.sun.enterprise.transaction.TransactionImport
javaeeTM
Constructors Summary
private TransactionImportManager()

    
      
        try {
            javaeeTM = (TransactionImport)TransactionManagerImpl.getInstance().getTransactionManager();
        } catch (ClassCastException cce) {
            final String CLASSNAME = javaeeTM == null ? "null" : javaeeTM.getClass().getName();
            logger.severe("TransactionImportManager", 
                          LocalizationMessages.NO_TXN_IMPORT_2014(CLASSNAME), cce);
        }
    
Methods Summary
public static com.sun.enterprise.transaction.TransactionImportgetInstance()

        return instance;
    
public intgetTransactionRemainingTimeout()
Returns in seconds duration till current transaction times out. Returns negative value if transaction has already timedout. Returns 0 if there is no timeout. Returns 0 if any exceptions occur looking up remaining transaction timeout.

        final String METHOD = "getRemainingTimeout";
        int result = 0;
        try {
            result = javaeeTM.getTransactionRemainingTimeout();
        } catch (IllegalStateException ise) {
            if (logger.isLogging(Level.FINEST)) {
                logger.finest(METHOD, "looking up remaining txn timeout, no current transaction", ise);
            } else {
                logger.info(METHOD, LocalizationMessages.TXN_MGR_OPERATION_FAILED_2008("getTransactionRemainingTimeout",
                                                                                    ise.getLocalizedMessage()));
            }
        } catch (Throwable t) {
            if (logger.isLogging(Level.FINEST)) {
                logger.finest(METHOD, "ignoring exception " + t.getClass().getName() + " thrown calling" +
                        "TM.getTransactionRemainingTimeout method" );
            } else {
                logger.info(METHOD, LocalizationMessages.TXN_MGR_OPERATION_FAILED_2008("getTransactionRemainingTimeout", 
                        t.getLocalizedMessage()));
         
            }
        }
        return result;
    
public javax.resource.spi.XATerminatorgetXATerminator()
Used to import an external transaction into Java EE TM.

        return javaeeTM.getXATerminator();
    
public voidrecreate(javax.transaction.xa.Xid xid, long timeout)
Recreate a transaction based on the Xid. This call causes the calling thread to be associated with the specified transaction.

param
xid the Xid object representing a transaction.

       javaeeTM.recreate(xid, timeout);
    
public voidrelease(javax.transaction.xa.Xid xid)
Release a transaction. This call causes the calling thread to be dissociated from the specified transaction.

param
xid the Xid object representing a transaction.

        javaeeTM.release(xid);