public class TransactionLockService extends java.lang.Object implements ApplicationLogging
TransactionLockFactory| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
TransactionLockService()
Create a new empty lock service.
|
TransactionLockService(ClientLockManager pLockManager,
java.lang.String pLockName,
ApplicationLogging pLogger)
Create a new lock service that uses the default key and provides no
logging
|
| Modifier and Type | Method and Description |
|---|---|
void |
acquireTransactionLock()
Acquire a lock named
lockName from clientLockManager |
void |
acquireTransactionLock(java.lang.String pLockName)
Acquire a lock with the given name from
clientLockManager |
ClientLockManager |
getClientLockManager()
The ClientLockManager that actually provides the locks
|
java.lang.String |
getLockName()
The name of the lock being used
|
ApplicationLogging |
getLogger()
Logger to use if logging messages
|
boolean |
isEnabled()
If this is false, then acquireTransactionLock and releaseTransactionLock are
both no-ops
|
boolean |
isLoggingDebug()
This method returns whether or not an debug log event should be
broadcast.
|
boolean |
isLoggingError()
This method returns whether or not an error log event should be
broadcast.
|
boolean |
isLoggingInfo()
This method returns whether or not an info log event should be
broadcast.
|
boolean |
isLoggingWarning()
This method returns whether or not an warning log event should be
broadcast.
|
void |
logDebug(java.lang.String pMessage)
Logs an debug event with the specified message
|
void |
logDebug(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs an debug event with the specified message and Throwable
|
void |
logDebug(java.lang.Throwable pThrowable)
Logs an debug event with the specified Throwable
|
void |
logError(java.lang.String pMessage)
Logs an error event with the specified message
|
void |
logError(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs an error event with the specified message and Throwable
|
void |
logError(java.lang.Throwable pThrowable)
Logs an error event with the specified Throwable
|
void |
logInfo(java.lang.String pMessage)
Logs an info event with the specified message
|
void |
logInfo(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs an info event with the specified message and Throwable
|
void |
logInfo(java.lang.Throwable pThrowable)
Logs an info event with the specified Throwable
|
void |
logWarning(java.lang.String pMessage)
Logs an warning event with the specified message
|
void |
logWarning(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs an warning event with the specified message and Throwable
|
void |
logWarning(java.lang.Throwable pThrowable)
Logs an warning event with the specified Throwable
|
void |
releaseTransactionLock()
Release the lock named
lockName from clientLockManager |
void |
releaseTransactionLock(java.lang.String pLockName)
Release the lock with the given name from
clientLockManager |
void |
setClientLockManager(ClientLockManager pClientLockManager) |
void |
setEnabled(boolean pEnabled) |
void |
setLockName(java.lang.String pLockName) |
void |
setLogger(ApplicationLogging pLogger) |
void |
setLoggingDebug(boolean pLogging)
Sets whether or not error log events should be logged.
|
void |
setLoggingError(boolean pLogging)
Sets whether or not error log events should be logged.
|
void |
setLoggingInfo(boolean pLogging)
Sets whether or not info log events should be logged.
|
void |
setLoggingWarning(boolean pLogging)
Sets whether or not warning log events should be logged.
|
public TransactionLockService()
public TransactionLockService(ClientLockManager pLockManager, java.lang.String pLockName, ApplicationLogging pLogger)
pLockManager - The lock manager that locks are obtained frompLockName - The name of the lock to get from pLockManagerpLogger - This is used to log any messages during acquisition and release of lockspublic void setEnabled(boolean pEnabled)
public boolean isEnabled()
public void setClientLockManager(ClientLockManager pClientLockManager)
public ClientLockManager getClientLockManager()
public void setLockName(java.lang.String pLockName)
public java.lang.String getLockName()
public void setLogger(ApplicationLogging pLogger)
public ApplicationLogging getLogger()
public void acquireTransactionLock()
throws DeadlockException,
atg.commerce.util.NoLockNameException
lockName from clientLockManagerDeadlockExceptionatg.commerce.util.NoLockNameExceptionpublic void acquireTransactionLock(java.lang.String pLockName)
throws DeadlockException,
atg.commerce.util.NoLockNameException
clientLockManagerDeadlockExceptionatg.commerce.util.NoLockNameExceptionpublic void releaseTransactionLock()
throws LockManagerException
lockName from clientLockManagerLockManagerExceptionpublic void releaseTransactionLock(java.lang.String pLockName)
throws LockManagerException
clientLockManagerLockManagerExceptionpublic boolean isLoggingInfo()
ApplicationLoggingisLoggingInfo in interface atg.core.logging.LoggingisLoggingInfo in interface ApplicationLoggingApplicationLogging.isLoggingInfo()public void setLoggingInfo(boolean pLogging)
ApplicationLoggingsetLoggingInfo in interface atg.core.logging.LoggingsetLoggingInfo in interface ApplicationLoggingApplicationLogging.setLoggingInfo(boolean)public boolean isLoggingWarning()
ApplicationLoggingisLoggingWarning in interface atg.core.logging.LoggingisLoggingWarning in interface ApplicationLoggingApplicationLogging.isLoggingWarning()public void setLoggingWarning(boolean pLogging)
ApplicationLoggingsetLoggingWarning in interface atg.core.logging.LoggingsetLoggingWarning in interface ApplicationLoggingApplicationLogging.setLoggingWarning(boolean)public boolean isLoggingError()
ApplicationLoggingisLoggingError in interface atg.core.logging.LoggingisLoggingError in interface ApplicationLoggingApplicationLogging.isLoggingError()public void setLoggingError(boolean pLogging)
ApplicationLoggingsetLoggingError in interface atg.core.logging.LoggingsetLoggingError in interface ApplicationLoggingApplicationLogging.setLoggingError(boolean)public boolean isLoggingDebug()
ApplicationLoggingisLoggingDebug in interface atg.core.logging.LoggingisLoggingDebug in interface ApplicationLoggingApplicationLogging.isLoggingDebug()public void setLoggingDebug(boolean pLogging)
ApplicationLoggingsetLoggingDebug in interface atg.core.logging.LoggingsetLoggingDebug in interface ApplicationLoggingApplicationLogging.setLoggingDebug(boolean)public void logInfo(java.lang.String pMessage)
ApplicationLogginglogInfo in interface atg.core.logging.LogginglogInfo in interface ApplicationLoggingApplicationLogging.logInfo(java.lang.String)public void logInfo(java.lang.Throwable pThrowable)
ApplicationLogginglogInfo in interface atg.core.logging.LogginglogInfo in interface ApplicationLoggingApplicationLogging.logInfo(java.lang.Throwable)public void logInfo(java.lang.String pMessage,
java.lang.Throwable pThrowable)
ApplicationLogginglogInfo in interface atg.core.logging.LogginglogInfo in interface ApplicationLoggingApplicationLogging.logInfo(java.lang.String, java.lang.Throwable)public void logWarning(java.lang.String pMessage)
ApplicationLogginglogWarning in interface atg.core.logging.LogginglogWarning in interface ApplicationLoggingApplicationLogging.logWarning(java.lang.String)public void logWarning(java.lang.Throwable pThrowable)
ApplicationLogginglogWarning in interface atg.core.logging.LogginglogWarning in interface ApplicationLoggingApplicationLogging.logWarning(java.lang.Throwable)public void logWarning(java.lang.String pMessage,
java.lang.Throwable pThrowable)
ApplicationLogginglogWarning in interface atg.core.logging.LogginglogWarning in interface ApplicationLoggingApplicationLogging.logWarning(java.lang.String, java.lang.Throwable)public void logError(java.lang.String pMessage)
ApplicationLogginglogError in interface atg.core.logging.LogginglogError in interface ApplicationLoggingApplicationLogging.logError(java.lang.String)public void logError(java.lang.Throwable pThrowable)
ApplicationLogginglogError in interface atg.core.logging.LogginglogError in interface ApplicationLoggingApplicationLogging.logError(java.lang.Throwable)public void logError(java.lang.String pMessage,
java.lang.Throwable pThrowable)
ApplicationLogginglogError in interface atg.core.logging.LogginglogError in interface ApplicationLoggingApplicationLogging.logError(java.lang.String, java.lang.Throwable)public void logDebug(java.lang.String pMessage)
ApplicationLogginglogDebug in interface atg.core.logging.LogginglogDebug in interface ApplicationLoggingApplicationLogging.logDebug(java.lang.String)public void logDebug(java.lang.Throwable pThrowable)
ApplicationLogginglogDebug in interface atg.core.logging.LogginglogDebug in interface ApplicationLoggingApplicationLogging.logDebug(java.lang.Throwable)public void logDebug(java.lang.String pMessage,
java.lang.Throwable pThrowable)
ApplicationLogginglogDebug in interface atg.core.logging.LogginglogDebug in interface ApplicationLoggingApplicationLogging.logDebug(java.lang.String, java.lang.Throwable)