com.caucho.sql.spy
Class SpyXAResource

java.lang.Object
  extended by com.caucho.sql.spy.SpyXAResource
All Implemented Interfaces:
XAResource

public class SpyXAResource
extends java.lang.Object
implements XAResource

Spying on a connection.


Field Summary
protected static L10N L
           
protected static java.util.logging.Logger log
           
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Constructor Summary
SpyXAResource(java.lang.String id, XAResource resource)
          Creates a new SpyXAResource
 
Method Summary
 void commit(Xid xid, boolean onePhase)
          Commits the resource
 void end(Xid xid, int flags)
          Starts the resource.
 void forget(Xid xid)
          Forgets the transaction
 int getTransactionTimeout()
          Gets the transaction timeout.
 XAResource getXAResource()
          Returns the underlying resource.
 boolean isSameRM(XAResource resource)
          Returns true if the underlying RM is the same.
protected  void log(long start, java.lang.String msg)
           
 int prepare(Xid xid)
          Rolls the resource back
 Xid[] recover(int flags)
          Rolls the resource back
 void rollback(Xid xid)
          Rolls the resource back
 boolean setTransactionTimeout(int seconds)
          Sets the transaction timeout.
protected  long start()
           
 void start(Xid xid, int flags)
          Starts the resource.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final java.util.logging.Logger log

L

protected static final L10N L
Constructor Detail

SpyXAResource

public SpyXAResource(java.lang.String id,
                     XAResource resource)
Creates a new SpyXAResource

Method Detail

getXAResource

public XAResource getXAResource()
Returns the underlying resource.


start

protected long start()

log

protected void log(long start,
                   java.lang.String msg)

setTransactionTimeout

public boolean setTransactionTimeout(int seconds)
                              throws XAException
Sets the transaction timeout.

Specified by:
setTransactionTimeout in interface XAResource
Throws:
XAException

getTransactionTimeout

public int getTransactionTimeout()
                          throws XAException
Gets the transaction timeout.

Specified by:
getTransactionTimeout in interface XAResource
Throws:
XAException

isSameRM

public boolean isSameRM(XAResource resource)
                 throws XAException
Returns true if the underlying RM is the same.

Specified by:
isSameRM in interface XAResource
Throws:
XAException

start

public void start(Xid xid,
                  int flags)
           throws XAException
Starts the resource.

Specified by:
start in interface XAResource
Throws:
XAException

end

public void end(Xid xid,
                int flags)
         throws XAException
Starts the resource.

Specified by:
end in interface XAResource
Throws:
XAException

prepare

public int prepare(Xid xid)
            throws XAException
Rolls the resource back

Specified by:
prepare in interface XAResource
Throws:
XAException

commit

public void commit(Xid xid,
                   boolean onePhase)
            throws XAException
Commits the resource

Specified by:
commit in interface XAResource
Throws:
XAException

rollback

public void rollback(Xid xid)
              throws XAException
Rolls the resource back

Specified by:
rollback in interface XAResource
Throws:
XAException

recover

public Xid[] recover(int flags)
              throws XAException
Rolls the resource back

Specified by:
recover in interface XAResource
Throws:
XAException

forget

public void forget(Xid xid)
            throws XAException
Forgets the transaction

Specified by:
forget in interface XAResource
Throws:
XAException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object