|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.transaction.TransactionServiceImpl
public class TransactionServiceImpl
Default implementation of Transaction Service.
Default retry behaviour: see RetryingTransactionHelper.RetryingTransactionHelper()
Constructor Summary | |
---|---|
TransactionServiceImpl()
Construct defaults |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransactionServiceImpl()
Method Detail |
---|
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 TransactionService
public 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 TransactionService
public void setMaxRetries(int maxRetries)
RetryingTransactionHelper.setMaxRetries(int)
public void setMinRetryWaitMs(int minRetryWaitMs)
RetryingTransactionHelper.setMinRetryWaitMs(int)
public void setMaxRetryWaitMs(int maxRetryWaitMs)
RetryingTransactionHelper.setMaxRetryWaitMs(int)
public void setRetryWaitIncrementMs(int retryWaitIncrementMs)
RetryingTransactionHelper.setRetryWaitIncrementMs(int)
public javax.transaction.UserTransaction getUserTransaction()
TransactionService
getUserTransaction
in interface TransactionService
TransactionDefinition.PROPAGATION_REQUIRED
public javax.transaction.UserTransaction getUserTransaction(boolean readOnly)
TransactionService
getUserTransaction
in interface TransactionService
readOnly
- 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_REQUIRED
public javax.transaction.UserTransaction getUserTransaction(boolean readOnly, boolean ignoreSystemReadOnly)
TransactionService
getUserTransaction
in interface TransactionService
readOnly
- 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_REQUIRED
public javax.transaction.UserTransaction getNonPropagatingUserTransaction()
TransactionService
getNonPropagatingUserTransaction
in interface TransactionService
TransactionDefinition.PROPAGATION_REQUIRES_NEW
public javax.transaction.UserTransaction getNonPropagatingUserTransaction(boolean readOnly)
TransactionService
getNonPropagatingUserTransaction
in interface TransactionService
readOnly
- 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_NEW
public javax.transaction.UserTransaction getNonPropagatingUserTransaction(boolean readOnly, boolean ignoreSystemReadOnly)
TransactionService
getNonPropagatingUserTransaction
in interface TransactionService
readOnly
- 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_NEW
public RetryingTransactionHelper getRetryingTransactionHelper()
getRetryingTransactionHelper
in interface TransactionService
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |