|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.slim3.datasource.XAResourceImpl
public class XAResourceImpl
An implementation class for XAResource
.
Field Summary | |
---|---|
protected Connection |
connection
The connection. |
protected Xid |
currentXid
The current transaction identifier. |
protected XAConnectionImpl |
pooledConnection
The pooled connection. |
Fields inherited from interface javax.transaction.xa.XAResource |
---|
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
Constructor Summary | |
---|---|
XAResourceImpl(XAConnectionImpl pooledConnection)
Constructor. |
Method Summary | |
---|---|
protected void |
assertSameXid(Xid xid)
Asserts the transaction identifier is same current transaction identifier. |
protected void |
begin(Xid xid)
Begins transaction. |
void |
commit(Xid xid,
boolean onePhase)
|
void |
end(Xid xid,
int flags)
|
void |
forget(Xid xid)
|
Connection |
getConnection()
Returns the connection. |
Xid |
getCurrentXid()
Returns the current transaction identifier. |
int |
getTransactionTimeout()
|
boolean |
isSameRM(XAResource xar)
|
int |
prepare(Xid xid)
|
Xid[] |
recover(int flag)
|
protected void |
resume(Xid xid)
Resumes transaction. |
void |
rollback(Xid xid)
|
boolean |
setTransactionTimeout(int timeout)
|
void |
start(Xid xid,
int flags)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Xid currentXid
protected XAConnectionImpl pooledConnection
protected Connection connection
Constructor Detail |
---|
public XAResourceImpl(XAConnectionImpl pooledConnection) throws NullPointerException
pooledConnection
- the pooled connection
NullPointerException
- if the pooledConnection parameter is nullMethod Detail |
---|
public void start(Xid xid, int flags) throws NullPointerException, XAException
start
in interface XAResource
NullPointerException
XAException
protected void begin(Xid xid) throws XAException
xid
- the transaction identifier.
XAException
- if a SQLException is encountered.protected void resume(Xid xid) throws XAException
xid
- the transaction identifier
XAException
- if an exception is encountered.public void end(Xid xid, int flags) throws NullPointerException, XAException
end
in interface XAResource
NullPointerException
XAException
public int prepare(Xid xid) throws NullPointerException, XAException
prepare
in interface XAResource
NullPointerException
XAException
public void commit(Xid xid, boolean onePhase) throws NullPointerException, XAException
commit
in interface XAResource
NullPointerException
XAException
public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
XAException
public void forget(Xid xid) throws NullPointerException, XAException
forget
in interface XAResource
NullPointerException
XAException
public Xid[] recover(int flag) throws XAException
recover
in interface XAResource
XAException
public boolean isSameRM(XAResource xar) throws XAException
isSameRM
in interface XAResource
XAException
public int getTransactionTimeout() throws XAException
getTransactionTimeout
in interface XAResource
XAException
public boolean setTransactionTimeout(int timeout) throws XAException
setTransactionTimeout
in interface XAResource
XAException
public Xid getCurrentXid()
public Connection getConnection()
protected void assertSameXid(Xid xid) throws IllegalStateException
xid
- the transaction identifier
IllegalStateException
- if the transaction identifier is not same current transaction
identifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |