public class LockManager extends Synchronizable
appName, dataPrefix, eacHost, eacPort, elementId, lockManager, logDir, sslEnabled, workingDir
Constructor and Description |
---|
LockManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
acquireLock()
Convenience wrapper that calls acquireLock(String) with a null string.
|
boolean |
acquireLock(String lockName)
Tries to acquire a lock.
|
boolean |
acquireLockBlocking(long maxWaitSeconds)
Convenience wrapper that calls acquireLockBlocking(String) with a null string.
|
boolean |
acquireLockBlocking(String lockName,
long maxWaitSeconds)
Tries to acquire a lock.
|
void |
addHeldLock(String lockName)
Adds a lock to the list of held locks.
|
List<String> |
getHeldLocks()
Gets a list of held locks.
|
boolean |
isLockHeld(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(String lockName)
Releases a lock.
|
void |
removeHeldLock(String lockName)
Removes a lock from the list of held locks.
|
void |
setHeldLocks(List<String> heldLocks)
Sets a list of held locks.
|
void |
setReleaseLocksOnFailure(boolean releaseLocksOnFailure) |
isFlagSet, listFlags, removeFlag, setFlag, waitForFlagSet
getAppName, getDataPrefix, getEacHost, getEacPort, getElementId, getLockManager, getLogDir, getWorkingDir, isSslEnabled, setAppName, setDataPrefix, setEacHost, setEacPort, setElementId, setLockManager, setLogDir, setSslEnabled, setWorkingDir
public boolean acquireLock(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
public boolean acquireLockBlocking(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
public void releaseLock(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 List<String> getHeldLocks()
public void setHeldLocks(List<String> heldLocks)
heldLocks
- List to set.public void addHeldLock(String lockName)
lockName
- Name of the lock to add.public void removeHeldLock(String lockName)
lockName
- Name of the lock to remove.public boolean isLockHeld(String lockName)
lockName
- Name of the lock to test.public void releaseHeldLocks()
public boolean isReleaseLocksOnFailure()
public void setReleaseLocksOnFailure(boolean releaseLocksOnFailure)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.