FileDocCategorySizeDatePackage
JcaXAResourceWrapper.javaAPI DocJBoss 4.2.13423Fri Jul 13 21:01:18 BST 2007org.jboss.resource.connectionmanager.xa

JcaXAResourceWrapper

public class JcaXAResourceWrapper extends Object implements XAResource
A XAResourceWrapper supporting JCA specific constructs for XAResource management primarily the isSameRMOverrideValue.
author
Weston Price
version
$Revision: 1.1 $

Fields Summary
private static final Logger
log
private final XAResource
resource
private Boolean
overrideSameRM
Constructors Summary
public JcaXAResourceWrapper(XAResource resource, Boolean overrideSameRM)

  
         
   
      this.resource = resource;
      this.overrideSameRM = overrideSameRM;
   
Methods Summary
public voidcommit(javax.transaction.xa.Xid xid, boolean onePhase)

      resource.commit(xid, onePhase);
   
public voidend(javax.transaction.xa.Xid xid, int flags)

      resource.end(xid, flags);
   
public voidforget(javax.transaction.xa.Xid xid)

      resource.forget(xid);
   
public intgetTransactionTimeout()

      return resource.getTransactionTimeout();
   
public javax.transaction.xa.XAResourcegetUnderlyingXAResource()

      return this.resource;
   
public booleanisSameRM(javax.transaction.xa.XAResource xaRes)

      
      if(overrideSameRM != null)
      {
         return overrideSameRM.booleanValue();         
      }
      
      if(xaRes instanceof JcaXAResourceWrapper)
      {
         final JcaXAResourceWrapper jca = (JcaXAResourceWrapper)xaRes;         
         xaRes = jca.getUnderlyingXAResource();         
      }
      
      final XAResource current = getUnderlyingXAResource();
      
      return current.isSameRM(xaRes);
      
   
public intprepare(javax.transaction.xa.Xid xid)

      return resource.prepare(xid);
   
public javax.transaction.xa.Xid[]recover(int flag)

      return resource.recover(flag);
   
public voidrollback(javax.transaction.xa.Xid xid)

      resource.rollback(xid);
   
public booleansetTransactionTimeout(int seconds)

      return resource.setTransactionTimeout(seconds);
   
public voidstart(javax.transaction.xa.Xid xid, int flags)

      resource.start(xid, flags);