public class SpyXAResource extends java.lang.Object implements XAResource
Modifier and Type | Field and Description |
---|---|
protected static L10N |
L |
protected static java.util.logging.Logger |
log |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
Constructor and Description |
---|
SpyXAResource(java.lang.String id,
XAResource resource)
Creates a new SpyXAResource
|
Modifier and Type | Method and Description |
---|---|
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() |
protected static final java.util.logging.Logger log
protected static final L10N L
public SpyXAResource(java.lang.String id, XAResource resource)
public XAResource getXAResource()
protected long start()
protected void log(long start, java.lang.String msg)
public boolean setTransactionTimeout(int seconds) throws XAException
setTransactionTimeout
in interface XAResource
XAException
public int getTransactionTimeout() throws XAException
getTransactionTimeout
in interface XAResource
XAException
public boolean isSameRM(XAResource resource) throws XAException
isSameRM
in interface XAResource
XAException
public void start(Xid xid, int flags) throws XAException
start
in interface XAResource
XAException
public void end(Xid xid, int flags) throws XAException
end
in interface XAResource
XAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
XAException
public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
XAException
public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
XAException
public Xid[] recover(int flags) throws XAException
recover
in interface XAResource
XAException
public void forget(Xid xid) throws XAException
forget
in interface XAResource
XAException
public java.lang.String toString()
toString
in class java.lang.Object