public abstract class FqnLockManager extends AbstractLockManager
configuration, lockAcquisitionTimeout| Constructor and Description |
|---|
FqnLockManager() |
| Modifier and Type | Method and Description |
|---|---|
Collection<Object> |
getReadOwners(NodeSPI node)
Retrieves the read lock owners, if any, for the current Fqn.
|
Object |
getWriteOwner(NodeSPI node)
Retrieves the write lock owner, if any, for the current Fqn.
|
boolean |
isLocked(NodeSPI node)
Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
|
boolean |
lock(NodeSPI node,
LockType lockType,
Object owner)
As
LockManager.lock(org.jboss.cache.Fqn, LockType, Object) except that a NodeSPI is passed in instead of an Fqn. |
boolean |
lock(NodeSPI node,
LockType lockType,
Object owner,
long timeout)
As
LockManager.lock(org.jboss.cache.Fqn, LockType, Object, long) except that a NodeSPI is passed in instead of an Fqn. |
boolean |
lockAndRecord(NodeSPI node,
LockType lockType,
InvocationContext ctx)
Acquires a lock of type lockType, on a specific Node in the cache, denoted by fqn.
|
boolean |
ownsLock(NodeSPI node,
Object owner)
Tests whether a given owner owns any sort of lock on a particular Fqn.
|
void |
unlock(NodeSPI node,
Object owner)
Releases the lock passed in, held by the specified owner
|
getLockOwner, injectConfiguration, setLockAcquisitionTimeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetReadOwners, getWriteOwner, isLocked, isLocked, lock, lock, lockAll, lockAll, lockAll, lockAllAndRecord, lockAllAndRecord, lockAndRecord, ownsLock, ownsLock, printLockInfo, printLockInfo, unlock, unlock, unlockAll, unlockAllpublic boolean lock(NodeSPI node, LockType lockType, Object owner) throws InterruptedException
LockManagerLockManager.lock(org.jboss.cache.Fqn, LockType, Object) except that a NodeSPI is passed in instead of an Fqn.node - node to locklockType - type of lock to acquireowner - owner to acquire the lock forInterruptedExceptionpublic boolean lock(NodeSPI node, LockType lockType, Object owner, long timeout) throws InterruptedException
LockManagerLockManager.lock(org.jboss.cache.Fqn, LockType, Object, long) except that a NodeSPI is passed in instead of an Fqn.node - node to locklockType - type of lock to acquireowner - owner to acquire the lock fortimeout - maximum length of time to wait for (in millis)InterruptedExceptionpublic boolean lockAndRecord(NodeSPI node, LockType lockType, InvocationContext ctx) throws InterruptedException
LockManagerOption.getLockAcquisitionTimeout() and, if this is unset, the default timeout
set in Configuration.getLockAcquisitionTimeout() is used.
In addition, any locks acquired are added to the context OR transaction entry using InvocationContext.addLock(Object).
The owner for the lock is determined by passing the invocation context to LockManager.getLockOwner(org.jboss.cache.InvocationContext).
node - Fqn to locklockType - type of lock to acquirectx - invocation context associated with this invocationInterruptedExceptionpublic void unlock(NodeSPI node, Object owner)
LockManagernode - Node to unlockowner - lock ownerpublic boolean ownsLock(NodeSPI node, Object owner)
LockManagernode - to testowner - ownerpublic Object getWriteOwner(NodeSPI node)
LockManagernode - the node to inspectpublic Collection<Object> getReadOwners(NodeSPI node)
LockManagernode - the node to inspectpublic boolean isLocked(NodeSPI node)
LockManagernode - node to inspectCopyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.