public abstract class AbstractJiniTransactionManager extends AbstractPlatformTransactionManager implements JiniPlatformTransactionManager, InitializingBean, BeanNameAware, ServiceDetailsProvider, DisposableBean
PlatformTransactionManager. Uses Jini
TransactionManager in order to manage transactions with sub classes responsible for
providing it using doCreateTransactionManager().
Jini transactions are bounded under the setTransactionalContext(Object) using Springs
TransactionSynchronizationManager.bindResource(Object,Object). The transactional context
is optional and defaults to the Jini TransactionManager instance. Note, this can be
overridden by sub classes.
By default the transaction timeout will be 90 seconds. The default timeout on the
transaction manager level can be set using AbstractPlatformTransactionManager.setDefaultTimeout(int). If the timeout is
explicitly set using Spring support for transactions (for example using
TransactionDefinition) this value will be used.
DefaultTransactionProvider,
JiniTransactionHolder,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractJiniTransactionManager.JiniTransactionObject
Jini Transaction object.
|
static class |
AbstractJiniTransactionManager.UnexpectedTransactionException |
AbstractPlatformTransactionManager.SuspendedResourcesHolder| Modifier and Type | Field and Description |
|---|---|
protected String |
beanName |
protected static String |
SERVICE_TYPE |
logger, SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION| Constructor and Description |
|---|
AbstractJiniTransactionManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
applyIsolationLevel(AbstractJiniTransactionManager.JiniTransactionObject txObject,
int isolationLevel) |
protected RuntimeException |
convertJiniException(Exception exception) |
void |
destroy() |
protected void |
doBegin(Object transaction,
TransactionDefinition definition) |
protected void |
doCleanupAfterCompletion(Object transaction) |
protected void |
doCommit(DefaultTransactionStatus status) |
protected abstract TransactionManager |
doCreateTransactionManager()
Implemented by sub classes to provide a Jini
TransactionManager. |
protected Object |
doGetTransaction() |
protected void |
doJiniBegin(AbstractJiniTransactionManager.JiniTransactionObject txObject,
TransactionDefinition definition) |
protected void |
doResume(Object transaction,
Object suspendedResources) |
protected void |
doRollback(DefaultTransactionStatus status) |
protected void |
doSetRollbackOnly(DefaultTransactionStatus status) |
protected Object |
doSuspend(Object transaction) |
String |
getBeanName() |
Object |
getTransactionalContext()
Returns the transactional context the jini transaction is bounded under (usually using Spring
synchronization which is based on thread local).
|
TransactionManager |
getTransactionManager() |
protected boolean |
isExistingTransaction(Object transaction) |
protected String |
logMessage(String message) |
void |
setBeanName(String beanName) |
void |
setCommitTimeout(Long commitTimeout)
Sets an optional timeout when performing commit in milliseconds.
|
void |
setLeaseRenewalConfig(TransactionLeaseRenewalConfig leaseRenewalConfig)
Sets the transaction lease renewal configuration.
|
void |
setRollbackTimeout(Long rollbackTimeout)
Sets an optional timeout when performing rollback/abort in milliseconds.
|
void |
setTransactionalContext(Object txResource) |
protected boolean |
suppportsCustomIsolationLevel() |
protected boolean |
useSavepointForNestedTransaction() |
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcommit, getTransaction, rollbackgetServicesDetailsprotected static final String SERVICE_TYPE
protected String beanName
public void setBeanName(String beanName)
setBeanName in interface BeanNameAwarepublic String getBeanName()
getBeanName in interface JiniPlatformTransactionManagerpublic Object getTransactionalContext()
JiniPlatformTransactionManagergetTransactionalContext in interface JiniPlatformTransactionManagerpublic void setTransactionalContext(Object txResource)
public void setCommitTimeout(Long commitTimeout)
DEFAULT_TX_COMMIT_TIMEOUT.public void setRollbackTimeout(Long rollbackTimeout)
DEFAULT_TX_ROLLBACK_TIMEOUT.public void setLeaseRenewalConfig(TransactionLeaseRenewalConfig leaseRenewalConfig)
protected abstract TransactionManager doCreateTransactionManager() throws Exception
TransactionManager.Exceptionpublic TransactionManager getTransactionManager()
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void destroy()
throws Exception
destroy in interface DisposableBeanExceptionprotected Object doGetTransaction() throws TransactionException
doGetTransaction in class AbstractPlatformTransactionManagerTransactionExceptionprotected void doBegin(Object transaction, TransactionDefinition definition) throws TransactionException
doBegin in class AbstractPlatformTransactionManagerTransactionExceptionprotected void doJiniBegin(AbstractJiniTransactionManager.JiniTransactionObject txObject, TransactionDefinition definition)
protected void applyIsolationLevel(AbstractJiniTransactionManager.JiniTransactionObject txObject, int isolationLevel) throws InvalidIsolationLevelException
InvalidIsolationLevelExceptionprotected boolean suppportsCustomIsolationLevel()
protected void doCommit(DefaultTransactionStatus status) throws TransactionException
doCommit in class AbstractPlatformTransactionManagerTransactionExceptionprotected boolean isExistingTransaction(Object transaction) throws TransactionException
isExistingTransaction in class AbstractPlatformTransactionManagerTransactionExceptionprotected void doRollback(DefaultTransactionStatus status) throws TransactionException
doRollback in class AbstractPlatformTransactionManagerTransactionExceptionprotected void doCleanupAfterCompletion(Object transaction)
doCleanupAfterCompletion in class AbstractPlatformTransactionManagerprotected void doSetRollbackOnly(DefaultTransactionStatus status) throws TransactionException
doSetRollbackOnly in class AbstractPlatformTransactionManagerTransactionExceptionprotected void doResume(Object transaction, Object suspendedResources) throws TransactionException
doResume in class AbstractPlatformTransactionManagerTransactionExceptionprotected Object doSuspend(Object transaction) throws TransactionException
doSuspend in class AbstractPlatformTransactionManagerTransactionExceptionprotected boolean useSavepointForNestedTransaction()
useSavepointForNestedTransaction in class AbstractPlatformTransactionManagerprotected RuntimeException convertJiniException(Exception exception)
Copyright © GigaSpaces.