com.sun.enterprise.transaction.api
Class XAResourceWrapper

java.lang.Object
  extended by com.sun.enterprise.transaction.api.XAResourceWrapper
All Implemented Interfaces:
XAResource

public abstract class XAResourceWrapper
extends java.lang.Object
implements XAResource

Wrappers over XAResources extend from this class. This class simply implements the the standard XAResource interface. In addition it holds the XAConnection which is set by XARecoveryManager and is used by deriving classes to implement workarounds. An example of class extending from this is OracleXARescource.

Version:
1.0
Author:
Bala Dutt

Field Summary
protected  ManagedConnection m_xacon
           
protected  javax.security.auth.Subject subject
           
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Constructor Summary
XAResourceWrapper()
           
 
Method Summary
abstract  void commit(Xid xid, boolean flag)
           
 void end(Xid xid, int i)
           
 void forget(Xid xid)
           
abstract  XAResourceWrapper getInstance()
          public Xid[] recover(int flag) throws XAException { throw new XAException("This is to be implemented by sub classes"); } public void commit(Xid xid, boolean flag) throws XAException{ throw new XAException("This is to be implemented by sub classes"); } public void rollback(Xid xid) throws XAException{ throw new XAException("This is to be implemented by sub classes"); }
 int getTransactionTimeout()
           
 void init(ManagedConnection xacon, javax.security.auth.Subject subject)
           
 boolean isSameRM(XAResource xaresource)
           
 int prepare(Xid xid)
           
abstract  Xid[] recover(int flag)
           
abstract  void rollback(Xid xid)
           
 boolean setTransactionTimeout(int i)
           
 void start(Xid xid, int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_xacon

protected ManagedConnection m_xacon

subject

protected javax.security.auth.Subject subject
Constructor Detail

XAResourceWrapper

public XAResourceWrapper()
Method Detail

init

public void init(ManagedConnection xacon,
                 javax.security.auth.Subject subject)

end

public void end(Xid xid,
                int i)
         throws XAException
Specified by:
end in interface XAResource
Throws:
XAException

forget

public void forget(Xid xid)
            throws XAException
Specified by:
forget in interface XAResource
Throws:
XAException

getTransactionTimeout

public int getTransactionTimeout()
                          throws XAException
Specified by:
getTransactionTimeout in interface XAResource
Throws:
XAException

isSameRM

public boolean isSameRM(XAResource xaresource)
                 throws XAException
Specified by:
isSameRM in interface XAResource
Throws:
XAException

prepare

public int prepare(Xid xid)
            throws XAException
Specified by:
prepare in interface XAResource
Throws:
XAException

setTransactionTimeout

public boolean setTransactionTimeout(int i)
                              throws XAException
Specified by:
setTransactionTimeout in interface XAResource
Throws:
XAException

start

public void start(Xid xid,
                  int i)
           throws XAException
Specified by:
start in interface XAResource
Throws:
XAException

recover

public abstract Xid[] recover(int flag)
                       throws XAException
Specified by:
recover in interface XAResource
Throws:
XAException

commit

public abstract void commit(Xid xid,
                            boolean flag)
                     throws XAException
Specified by:
commit in interface XAResource
Throws:
XAException

rollback

public abstract void rollback(Xid xid)
                       throws XAException
Specified by:
rollback in interface XAResource
Throws:
XAException

getInstance

public abstract XAResourceWrapper getInstance()
public Xid[] recover(int flag) throws XAException { throw new XAException("This is to be implemented by sub classes"); } public void commit(Xid xid, boolean flag) throws XAException{ throw new XAException("This is to be implemented by sub classes"); } public void rollback(Xid xid) throws XAException{ throw new XAException("This is to be implemented by sub classes"); }



Copyright © 2012 GlassFish Community. All Rights Reserved.