Class GenericXaResource
java.lang.Object
java.lang.Thread
org.apache.ofbiz.entity.transaction.GenericXaResource
- All Implemented Interfaces:
Runnable
,XAResource
- Direct Known Subclasses:
DebugXaResource
,ServiceXaWrapper
GenericXaResource - Abstract XA Resource implementation supporting a single transaction
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
void
void
enlist()
Enlists this resource in the current transactionvoid
enlist
(javax.transaction.Transaction tx) Enlists this resource in the current transactionvoid
javax.transaction.Transaction
Gets transaction.int
getXid()
Gets xid.boolean
isActive()
Is active boolean.boolean
isSameRM
(XAResource xaResource) int
Xid[]
recover
(int flag) abstract void
void
run()
void
Method which will run when the transaction times outvoid
setActive
(boolean active) Sets active.void
setTransaction
(javax.transaction.Transaction t) Sets transaction.boolean
setTransactionTimeout
(int seconds) void
Sets xid.void
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
GenericXaResource
public GenericXaResource()
-
-
Method Details
-
enlist
Enlists this resource in the current transaction- Throws:
XAException
-
enlist
Enlists this resource in the current transaction- Throws:
XAException
-
start
- Specified by:
start
in interfaceXAResource
- Throws:
XAException
-
end
- Specified by:
end
in interfaceXAResource
- Throws:
XAException
-
forget
- Specified by:
forget
in interfaceXAResource
- Throws:
XAException
-
prepare
- Specified by:
prepare
in interfaceXAResource
- Throws:
XAException
-
recover
- Specified by:
recover
in interfaceXAResource
- Throws:
XAException
-
isSameRM
- Specified by:
isSameRM
in interfaceXAResource
- Throws:
XAException
-
getTransactionTimeout
- Specified by:
getTransactionTimeout
in interfaceXAResource
- Throws:
XAException
-
setTransactionTimeout
- Specified by:
setTransactionTimeout
in interfaceXAResource
- Throws:
XAException
-
getTransaction
public javax.transaction.Transaction getTransaction()Gets transaction.- Returns:
- the transaction
-
setTransaction
public void setTransaction(javax.transaction.Transaction t) Sets transaction.- Parameters:
t
- the t
-
setActive
public void setActive(boolean active) Sets active.- Parameters:
active
- the active
-
isActive
public boolean isActive()Is active boolean.- Returns:
- the boolean
-
setXid
Sets xid.- Parameters:
xid
- the xid
-
getXid
Gets xid.- Returns:
- the xid
-
commit
- Specified by:
commit
in interfaceXAResource
- Throws:
XAException
-
rollback
- Specified by:
rollback
in interfaceXAResource
- Throws:
XAException
-
runOnTimeout
public void runOnTimeout()Method which will run when the transaction times out -
run
public void run()
-