|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.lock.AbstractLockManager org.jboss.cache.lock.FqnLockManager
public abstract class FqnLockManager
An abstract lock manager that deals with Fqns rather than nodes.
Field Summary |
---|
Fields inherited from class org.jboss.cache.lock.AbstractLockManager |
---|
configuration, lockAcquisitionTimeout |
Constructor Summary | |
---|---|
FqnLockManager()
|
Method Summary | |
---|---|
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 |
Methods inherited from class org.jboss.cache.lock.AbstractLockManager |
---|
getLockOwner, injectConfiguration, setLockAcquisitionTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.cache.lock.LockManager |
---|
getReadOwners, getWriteOwner, isLocked, isLocked, lock, lock, lockAll, lockAll, lockAll, lockAllAndRecord, lockAllAndRecord, lockAndRecord, ownsLock, ownsLock, printLockInfo, printLockInfo, unlock, unlock, unlockAll, unlockAll |
Constructor Detail |
---|
public FqnLockManager()
Method Detail |
---|
public boolean lock(NodeSPI node, LockType lockType, Object owner) throws InterruptedException
LockManager
LockManager.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 for
InterruptedException
public boolean lock(NodeSPI node, LockType lockType, Object owner, long timeout) throws InterruptedException
LockManager
LockManager.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)
InterruptedException
public boolean lockAndRecord(NodeSPI node, LockType lockType, InvocationContext ctx) throws InterruptedException
LockManager
Option.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 invocation
InterruptedException
public void unlock(NodeSPI node, Object owner)
LockManager
node
- Node to unlockowner
- lock ownerpublic boolean ownsLock(NodeSPI node, Object owner)
LockManager
node
- to testowner
- owner
public Object getWriteOwner(NodeSPI node)
LockManager
node
- the node to inspect
public Collection<Object> getReadOwners(NodeSPI node)
LockManager
node
- the node to inspect
public boolean isLocked(NodeSPI node)
LockManager
node
- node to inspect
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |