public class TransactionServiceImpl extends java.lang.Object implements TransactionService
Default retry behaviour: see RetryingTransactionHelper.RetryingTransactionHelper()
| Constructor and Description |
|---|
TransactionServiceImpl()
Construct defaults
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAllowWrite()
Determine if the repository has been put into read only mode.
|
javax.transaction.UserTransaction |
getNonPropagatingUserTransaction()
Gets a user transaction that ensures a new transaction is created.
|
javax.transaction.UserTransaction |
getNonPropagatingUserTransaction(boolean readOnly)
Gets a user transaction that ensures a new transaction is created.
|
javax.transaction.UserTransaction |
getNonPropagatingUserTransaction(boolean readOnly,
boolean ignoreSystemReadOnly)
Gets a user transaction that ensures a new transaction is created.
|
RetryingTransactionHelper |
getRetryingTransactionHelper()
Creates a new helper instance.
|
javax.transaction.UserTransaction |
getUserTransaction()
Gets a user transaction that supports transaction propagation.
|
javax.transaction.UserTransaction |
getUserTransaction(boolean readOnly)
Gets a user transaction that supports transaction propagation.
|
javax.transaction.UserTransaction |
getUserTransaction(boolean readOnly,
boolean ignoreSystemReadOnly)
Gets a user transaction that supports transaction propagation.
|
boolean |
isReadOnly()
Determine if ALL user transactions will be read-only.
|
void |
setAllowWrite(boolean allowWrite)
Set the read-only mode for all generated transactions.
|
void |
setAllowWrite(boolean allowWrite,
org.alfresco.service.namespace.QName nameOfVeto)
Set the read-only mode for all generated transactions.
|
void |
setAuthenticationContext(AuthenticationContext authenticationContext)
Sets the authentication context.
|
void |
setMaxRetries(int maxRetries) |
void |
setMaxRetryWaitMs(int maxRetryWaitMs) |
void |
setMinRetryWaitMs(int minRetryWaitMs) |
void |
setRetryWaitIncrementMs(int retryWaitIncrementMs) |
void |
setSysAdminParams(SysAdminParams sysAdminParams) |
void |
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
Set the transaction manager to use
|
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
public void setAuthenticationContext(AuthenticationContext authenticationContext)
authenticationContext - the authentication contextpublic void setSysAdminParams(SysAdminParams sysAdminParams)
public boolean getAllowWrite()
getAllowWrite in interface TransactionServicepublic void setAllowWrite(boolean allowWrite)
Intended for use by spring configuration only. Alfresco code should call the method which specifies a veto name.
allowWrite - false if all transactions must be read-onlypublic void setAllowWrite(boolean allowWrite,
org.alfresco.service.namespace.QName nameOfVeto)
By default read/write transactions are allowed however vetos may be applied that make the transactions read only.
Prevent writes by calling allowWrite with false and a given veto name.
The veto is removed by calling allowWrite with true for the given veto name when all vetos are removed then read/write transactions are allowed.
allowWrite - false if all transactions must be read-onlynameOfVeto - the name of the vetopublic boolean isReadOnly()
isReadOnly in interface TransactionServicepublic void setMaxRetries(int maxRetries)
public void setMinRetryWaitMs(int minRetryWaitMs)
public void setMaxRetryWaitMs(int maxRetryWaitMs)
public void setRetryWaitIncrementMs(int retryWaitIncrementMs)
public javax.transaction.UserTransaction getUserTransaction()
TransactionServicegetUserTransaction in interface TransactionServiceTransactionDefinition.PROPAGATION_REQUIREDpublic javax.transaction.UserTransaction getUserTransaction(boolean readOnly)
TransactionServicegetUserTransaction in interface TransactionServicereadOnly - Set true for a READONLY transaction instance, false otherwise.
Note that it is not always possible to force a write transaction if the
system is in read-only mode.TransactionDefinition.PROPAGATION_REQUIREDpublic javax.transaction.UserTransaction getUserTransaction(boolean readOnly,
boolean ignoreSystemReadOnly)
TransactionServicegetUserTransaction in interface TransactionServicereadOnly - Set true for a READONLY transaction instance, false otherwise.ignoreSystemReadOnly - true to force the read-only flag to be respected regardless
of the system read-only mode.TransactionDefinition.PROPAGATION_REQUIREDpublic javax.transaction.UserTransaction getNonPropagatingUserTransaction()
TransactionServicegetNonPropagatingUserTransaction in interface TransactionServiceTransactionDefinition.PROPAGATION_REQUIRES_NEWpublic javax.transaction.UserTransaction getNonPropagatingUserTransaction(boolean readOnly)
TransactionServicegetNonPropagatingUserTransaction in interface TransactionServicereadOnly - Set true for a READONLY transaction instance, false otherwise.
Note that it is not always possible to force a write transaction if the
system is in read-only mode.TransactionDefinition.PROPAGATION_REQUIRES_NEWpublic javax.transaction.UserTransaction getNonPropagatingUserTransaction(boolean readOnly,
boolean ignoreSystemReadOnly)
TransactionServicegetNonPropagatingUserTransaction in interface TransactionServicereadOnly - Set true for a READONLY transaction instance, false otherwise.ignoreSystemReadOnly - true to force the read-only flag to be respected regardless
of the system read-only mode.TransactionDefinition.PROPAGATION_REQUIRES_NEWpublic RetryingTransactionHelper getRetryingTransactionHelper()
getRetryingTransactionHelper in interface TransactionServiceCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.