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

ATTransactionImpl

public class ATTransactionImpl extends Object implements com.sun.xml.ws.api.tx.ATTransaction
Represents an WS-AT capable Transaction.

Also has reference to related Java EE transaction that it is associated with.

author
jf39279

Fields Summary
private final Transaction
txn
private final com.sun.xml.ws.tx.coordinator.CoordinationContextInterface
coordCtx
private final com.sun.xml.ws.tx.at.ATCoordinator
COORDINATOR
private static Map
coordIdATtxnMap
Constructors Summary
public ATTransactionImpl(Transaction jtaTxn, com.sun.xml.ws.tx.coordinator.CoordinationContextInterface coordCtx)
Creates a new instance of ATTransactionImpl

        this.txn = jtaTxn;
        this.coordCtx = coordCtx;
        COORDINATOR = 
               (ATCoordinator) CoordinationManager.getInstance().getCoordinator(coordCtx.getIdentifier());
    
Methods Summary
public voidcommit()

        //TODO: First pass only.  
        txn.commit();
    
public booleandelistResource(javax.transaction.xa.XAResource xAResource, int state)

        // TODO: First pass only.
        return txn.delistResource(xAResource, state);
    
public booleanenlistParticipant(com.sun.xml.ws.api.tx.Participant participant)

        final ATParticipant atParticipant =
                new ATParticipant(getATCoordinator(), participant);
        atParticipant.register();
        return true;
    
public booleanenlistResource(javax.transaction.xa.XAResource xaResource)
Wrapper XAResource as a participant and enlist with this transaction's coordinator.

Contemplating removing this method but leave for now.

XAResources from managed connections are automatically enlisted with Java EE transaction.

        return txn.enlistResource(xaResource);

    
public voidforget()

        coordIdATtxnMap.remove(coordCtx.getIdentifier());
    
public static com.sun.xml.ws.tx.common.ATTransactionImplget(java.lang.String coordinationId)


          
        return coordIdATtxnMap.get(coordinationId);
    
private com.sun.xml.ws.tx.coordinator.CoordinatorgetATCoordinator()
Get coordinator for this transaction.

        return COORDINATOR;
    
public intgetStatus()

        throw new UnsupportedOperationException("Not yet implemented");
    
public voidregisterSynchronization(javax.transaction.Synchronization synchronization)

        txn.registerSynchronization(synchronization);
    
public voidrollback()

        txn.rollback();
    
public voidsetRollbackOnly()

        txn.setRollbackOnly();