public abstract class AbstractTransactionService extends Object implements TransactionService
TransactionService. If you intend to use a TransactionManager in
standalone mode (not manager by your Application Server), you can set the
transaction timeout thanks to the value-param called timeout
the value of this parameter is expressed in seconds.| Modifier and Type | Field and Description |
|---|---|
protected int |
defaultTimeout
The default timeout
|
protected boolean |
forceTimeout
Indicates if the timeout has to be enforced
|
| Constructor and Description |
|---|
AbstractTransactionService() |
AbstractTransactionService(InitParams params) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delistResource(XAResource xares)
Delists XA resource from transaction manager.
|
boolean |
enlistResource(XAResource xares)
Enlists XA resource in transaction manager.
|
protected abstract TransactionManager |
findTransactionManager()
This method will try to find the current
TransactionManager |
protected UserTransaction |
findUserTransaction()
This method will try to find the current
UserTransaction, by default it will
simply wraps a TransactionManager |
int |
getDefaultTimeout() |
TransactionManager |
getTransactionManager() |
UserTransaction |
getUserTransaction() |
protected boolean |
isTMInitialized()
Indicates whether or not the
TransactionManager has been initialized |
void |
setTransactionTimeout(int seconds)
Sets timeout in seconds,
|
protected final int defaultTimeout
protected final boolean forceTimeout
public AbstractTransactionService()
public AbstractTransactionService(InitParams params)
public boolean delistResource(XAResource xares) throws RollbackException, SystemException
delistResource in interface TransactionServicexares - XAResourceSystemException - Thrown if the transaction manager
encounters an unexpected error condition.RollbackExceptionpublic boolean enlistResource(XAResource xares) throws RollbackException, SystemException
enlistResource in interface TransactionServicexares - XAResourceRollbackException - Thrown to indicate that
the transaction has been marked for rollback only.SystemException - Thrown if the transaction manager
encounters an unexpected error condition.public int getDefaultTimeout()
getDefaultTimeout in interface TransactionServicepublic final TransactionManager getTransactionManager()
getTransactionManager in interface TransactionServiceprotected boolean isTMInitialized()
TransactionManager has been initializedprotected abstract TransactionManager findTransactionManager() throws Exception
TransactionManagerTransactionManagerException - if an error occurs while looking for the TransactionManagerpublic final UserTransaction getUserTransaction()
getUserTransaction in interface TransactionServiceprotected UserTransaction findUserTransaction() throws Exception
UserTransaction, by default it will
simply wraps a TransactionManagerUserTransactionException - if an error occurs while looking for the UserTransactionpublic void setTransactionTimeout(int seconds)
throws SystemException
setTransactionTimeout in interface TransactionServiceseconds - intSystemExceptionCopyright © 2018 eXo Platform SAS. All Rights Reserved.