|
EAC Toolkit 3.2.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.soleng.eac.toolkit.base.EacElement com.endeca.soleng.eac.toolkit.base.Synchronizable com.endeca.soleng.eac.toolkit.base.LockManager
public class LockManager
Lock Manager used to acquire, track and release locks. A lock manager is associated with most applications. A pointer to the lock manager is inherited by every object defined in the application, allowing all objects a common interface to set and test flags and locks. This also allows the toolkit controller to release any locks obtained during script execution if a failure occurs. If this behavior is not desired, the lock manager can be configured not to release locks on failure.
Field Summary |
---|
Fields inherited from class com.endeca.soleng.eac.toolkit.base.EacElement |
---|
appName, dataPrefix, eacHost, eacPort, elementId, lockManager, logDir, sslEnabled, workingDir |
Constructor Summary | |
---|---|
LockManager()
|
Method Summary | |
---|---|
boolean |
acquireLock()
Convenience wrapper that calls acquireLock(String) with a null string. |
boolean |
acquireLock(java.lang.String lockName)
Tries to acquire a lock. |
boolean |
acquireLockBlocking(long maxWaitSeconds)
Convenience wrapper that calls acquireLockBlocking(String) with a null string. |
boolean |
acquireLockBlocking(java.lang.String lockName,
long maxWaitSeconds)
Tries to acquire a lock. |
void |
addHeldLock(java.lang.String lockName)
Adds a lock to the list of held locks. |
java.util.List<java.lang.String> |
getHeldLocks()
Gets a list of held locks. |
boolean |
isLockHeld(java.lang.String lockName)
Determined whether the specified lock is held by this object. |
boolean |
isReleaseLocksOnFailure()
|
void |
releaseHeldLocks()
Releases all locks held by this object. |
void |
releaseLock()
Convenience wrapper that calls releaseLock(String) with a null string. |
void |
releaseLock(java.lang.String lockName)
Releases a lock. |
void |
removeHeldLock(java.lang.String lockName)
Removes a lock from the list of held locks. |
void |
setHeldLocks(java.util.List<java.lang.String> heldLocks)
Sets a list of held locks. |
void |
setReleaseLocksOnFailure(boolean releaseLocksOnFailure)
|
Methods inherited from class com.endeca.soleng.eac.toolkit.base.Synchronizable |
---|
isFlagSet, listFlags, removeFlag, setFlag, waitForFlagSet |
Methods inherited from class com.endeca.soleng.eac.toolkit.base.EacElement |
---|
getAppName, getDataPrefix, getEacHost, getEacPort, getElementId, getLockManager, getLogDir, getWorkingDir, isSslEnabled, setAppName, setDataPrefix, setEacHost, setEacPort, setElementId, setLockManager, setLogDir, setSslEnabled, setWorkingDir |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LockManager()
Method Detail |
---|
public boolean acquireLock(java.lang.String lockName)
lockName
- The name of the lock to acquire, or null to indicate
that the class name should be used as the lock name.
public boolean acquireLock() throws EacCommunicationException, EacSynchronizationException
EacCommunicationException
EacSynchronizationException
public boolean acquireLockBlocking(java.lang.String lockName, long maxWaitSeconds)
lockName
- The name of the lock to acquire, or null to indicate
that the class name should be used as the lock name.maxWaitSeconds
- Maximum number of seconds to try to acquire lock.
public boolean acquireLockBlocking(long maxWaitSeconds) throws EacCommunicationException, EacSynchronizationException
EacCommunicationException
EacSynchronizationException
public void releaseLock(java.lang.String lockName)
lockName
- The name of the lock to remove, or null to indicate
that the class name should be used as the lock name.public void releaseLock()
public java.util.List<java.lang.String> getHeldLocks()
public void setHeldLocks(java.util.List<java.lang.String> heldLocks)
heldLocks
- List to set.public void addHeldLock(java.lang.String lockName)
lockName
- Name of the lock to add.public void removeHeldLock(java.lang.String lockName)
lockName
- Name of the lock to remove.public boolean isLockHeld(java.lang.String lockName)
lockName
- Name of the lock to test.
public void releaseHeldLocks()
public boolean isReleaseLocksOnFailure()
public void setReleaseLocksOnFailure(boolean releaseLocksOnFailure)
|
EAC Toolkit 3.2.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@VERSION PRODUCT: EAC Toolkit (eacToolkit) VERSION: 3.2.1 BUILD: NONE ARCH_OS: n/a DATE: 2011-11-10T16:21:05-0500