public abstract class AbstractJiniTransactionManager extends org.springframework.transaction.support.AbstractPlatformTransactionManager implements JiniPlatformTransactionManager, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanNameAware, ServiceDetailsProvider, org.springframework.beans.factory.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 FormModifier and Type | Class and Description |
---|---|
static class |
AbstractJiniTransactionManager.JiniTransactionObject
Jini Transaction object.
|
static class |
AbstractJiniTransactionManager.UnexpectedTransactionException |
Modifier and Type | Field and Description |
---|---|
protected String |
beanName |
protected static String |
SERVICE_TYPE |
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,
org.springframework.transaction.TransactionDefinition definition) |
protected void |
doCleanupAfterCompletion(Object transaction) |
protected void |
doCommit(org.springframework.transaction.support.DefaultTransactionStatus status) |
protected abstract TransactionManager |
doCreateTransactionManager()
Implemented by sub classes to provide a Jini
TransactionManager . |
protected Object |
doGetTransaction() |
protected void |
doJiniBegin(AbstractJiniTransactionManager.JiniTransactionObject txObject,
org.springframework.transaction.TransactionDefinition definition) |
protected void |
doResume(Object transaction,
Object suspendedResources) |
protected void |
doRollback(org.springframework.transaction.support.DefaultTransactionStatus status) |
protected void |
doSetRollbackOnly(org.springframework.transaction.support.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, triggerBeforeCompletion
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
commit, getTransaction, rollback
getServicesDetails
protected static final String SERVICE_TYPE
protected String beanName
public void setBeanName(String beanName)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public String getBeanName()
getBeanName
in interface JiniPlatformTransactionManager
public Object getTransactionalContext()
JiniPlatformTransactionManager
getTransactionalContext
in interface JiniPlatformTransactionManager
public 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
.Exception
public TransactionManager getTransactionManager()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
protected Object doGetTransaction() throws org.springframework.transaction.TransactionException
doGetTransaction
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doBegin(Object transaction, org.springframework.transaction.TransactionDefinition definition) throws org.springframework.transaction.TransactionException
doBegin
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doJiniBegin(AbstractJiniTransactionManager.JiniTransactionObject txObject, org.springframework.transaction.TransactionDefinition definition)
protected void applyIsolationLevel(AbstractJiniTransactionManager.JiniTransactionObject txObject, int isolationLevel) throws org.springframework.transaction.InvalidIsolationLevelException
org.springframework.transaction.InvalidIsolationLevelException
protected boolean suppportsCustomIsolationLevel()
protected void doCommit(org.springframework.transaction.support.DefaultTransactionStatus status) throws org.springframework.transaction.TransactionException
doCommit
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected boolean isExistingTransaction(Object transaction) throws org.springframework.transaction.TransactionException
isExistingTransaction
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doRollback(org.springframework.transaction.support.DefaultTransactionStatus status) throws org.springframework.transaction.TransactionException
doRollback
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doCleanupAfterCompletion(Object transaction)
doCleanupAfterCompletion
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
protected void doSetRollbackOnly(org.springframework.transaction.support.DefaultTransactionStatus status) throws org.springframework.transaction.TransactionException
doSetRollbackOnly
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected void doResume(Object transaction, Object suspendedResources) throws org.springframework.transaction.TransactionException
doResume
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected Object doSuspend(Object transaction) throws org.springframework.transaction.TransactionException
doSuspend
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.TransactionException
protected boolean useSavepointForNestedTransaction()
useSavepointForNestedTransaction
in class org.springframework.transaction.support.AbstractPlatformTransactionManager
protected RuntimeException convertJiniException(Exception exception)
Copyright © GigaSpaces.