@Deprecated public class NodeBasedLockManager extends AbstractLockManager
Modifier and Type | Field and Description |
---|---|
protected DataContainer |
dataContainer
Deprecated.
|
protected NodeSPI |
rootNode
Deprecated.
|
configuration, lockAcquisitionTimeout
Constructor and Description |
---|
NodeBasedLockManager()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Collection<Object> |
getReadOwners(Fqn f)
Deprecated.
Retrieves the read lock owners, if any, for the current Fqn.
|
Collection<Object> |
getReadOwners(NodeSPI node)
Deprecated.
Retrieves the read lock owners, if any, for the current Fqn.
|
Object |
getWriteOwner(Fqn f)
Deprecated.
Retrieves the write lock owner, if any, for the current Fqn.
|
Object |
getWriteOwner(NodeSPI node)
Deprecated.
Retrieves the write lock owner, if any, for the current Fqn.
|
void |
inject(DataContainer dataContainer)
Deprecated.
|
boolean |
isLocked(Fqn fqn)
Deprecated.
Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
|
boolean |
isLocked(NodeSPI n)
Deprecated.
Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
|
boolean |
isLocked(NodeSPI n,
LockType type)
Deprecated.
Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
|
boolean |
lock(Fqn fqn,
LockType lockType,
Object owner)
Deprecated.
Acquires a lock of type lockType, for a given owner, on a specific Node in the cache, denoted by fqn.
|
boolean |
lock(Fqn fqn,
LockType lockType,
Object owner,
long timeout)
Deprecated.
Acquires a lock of type lockType, for a given owner, on a specific Node in the cache, denoted by fqn.
|
boolean |
lock(NodeSPI node,
LockType lockType,
Object owner)
Deprecated.
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)
Deprecated.
As
LockManager.lock(org.jboss.cache.Fqn, LockType, Object, long) except that a NodeSPI is passed in instead of an Fqn. |
boolean |
lockAll(NodeSPI node,
LockType lockType,
Object owner)
Deprecated.
Locks the node and all child nodes, acquiring lock of type specified for the owner specified.
|
boolean |
lockAll(NodeSPI node,
LockType lockType,
Object owner,
long timeout)
Deprecated.
Locks the node and all child nodes, acquiring lock of type specified for the owner specified.
|
boolean |
lockAll(NodeSPI node,
LockType lockType,
Object owner,
long timeout,
boolean excludeInternalFqns)
Deprecated.
Locks the node and all child nodes, acquiring lock of type specified for the owner specified.
|
boolean |
lockAllAndRecord(Fqn fqn,
LockType lockType,
InvocationContext ctx)
Deprecated.
Locks the node and all child nodes, acquiring lock of type specified for the owner specified.
|
boolean |
lockAllAndRecord(NodeSPI node,
LockType lockType,
InvocationContext ctx)
Deprecated.
Locks the node and all child nodes, acquiring lock of type specified for the owner specified.
|
boolean |
lockAndRecord(Fqn fqn,
LockType lockType,
InvocationContext ctx)
Deprecated.
Acquires a lock of type lockType, on a specific Node in the cache, denoted by fqn.
|
boolean |
lockAndRecord(NodeSPI node,
LockType lockType,
InvocationContext ctx)
Deprecated.
Acquires a lock of type lockType, on a specific Node in the cache, denoted by fqn.
|
boolean |
ownsLock(Fqn fqn,
LockType lockType,
Object owner)
Deprecated.
Tests whether a given owner owns a lock of lockType on a particular Fqn.
|
boolean |
ownsLock(Fqn fqn,
Object owner)
Deprecated.
Tests whether a given owner owns any sort of lock on a particular Fqn.
|
boolean |
ownsLock(NodeSPI node,
Object owner)
Deprecated.
Tests whether a given owner owns any sort of lock on a particular Fqn.
|
String |
printLockInfo()
Deprecated.
Prints lock information for all locks.
|
String |
printLockInfo(NodeSPI node)
Deprecated.
Prints lock information about a node (and its children) to a String.
|
void |
setRootNode()
Deprecated.
|
void |
unlock(Fqn fqn,
Object owner)
Deprecated.
Releases the lock passed in, held by the specified owner
|
void |
unlock(InvocationContext ctx)
Deprecated.
Releases locks present in an invocation context and transaction entry, if one is available.
|
void |
unlock(NodeSPI node,
Object owner)
Deprecated.
Releases the lock passed in, held by the specified owner
|
void |
unlockAll(NodeSPI node)
Deprecated.
Releases locks on a given node and all children for all owners.
|
void |
unlockAll(NodeSPI node,
Object owner)
Deprecated.
Releases locks on a given node and all children for a given owner.
|
getLockOwner, injectConfiguration, setLockAcquisitionTimeout
protected DataContainer dataContainer
protected NodeSPI rootNode
public void inject(DataContainer dataContainer)
public void setRootNode()
public boolean lock(Fqn fqn, LockType lockType, Object owner)
LockManager
Configuration.getLockAcquisitionTimeout()
milliseconds and give up if it is unable to acquire the required lock.fqn
- Fqn to locklockType
- type of lock to acquireowner
- owner to acquire the lock forpublic boolean lock(Fqn fqn, LockType lockType, Object owner, long timeout)
LockManager
fqn
- Fqn to locklockType
- type of lock to acquireowner
- owner to acquire the lock fortimeout
- maximum length of time to wait for (in millis)public boolean lock(NodeSPI node, LockType lockType, Object owner)
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 forpublic boolean lock(NodeSPI node, LockType lockType, Object owner, long timeout)
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)public boolean lockAndRecord(Fqn fqn, LockType lockType, InvocationContext ctx)
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)
.
fqn
- Fqn to locklockType
- type of lock to acquirectx
- invocation context associated with this invocationpublic boolean lockAndRecord(NodeSPI node, LockType lockType, InvocationContext ctx)
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 invocationpublic void unlock(InvocationContext ctx)
LockManager
LockManager.getLockOwner(org.jboss.cache.InvocationContext)
ctx
- invocation context to inspectpublic void unlock(Fqn fqn, Object owner)
LockManager
fqn
- Fqn of the node to unlockowner
- lock ownerpublic void unlock(NodeSPI node, Object owner)
LockManager
node
- Node to unlockowner
- lock ownerpublic boolean lockAll(NodeSPI node, LockType lockType, Object owner)
LockManager
Configuration.getLockAcquisitionTimeout()
milliseconds and give up if it is unable to acquire the required lock.
node
- Node to locklockType
- type of lock to acquireowner
- owner to acquire the lock forpublic boolean lockAll(NodeSPI node, LockType lockType, Object owner, long timeout)
LockManager
node
- Node to locklockType
- type of lock to acquireowner
- owner to acquire the lock fortimeout
- maximum length of time to wait for (in millis)public boolean lockAll(NodeSPI node, LockType lockType, Object owner, long timeout, boolean excludeInternalFqns)
LockManager
node
- Node to locklockType
- type of lock to acquireowner
- owner to acquire the lock fortimeout
- maximum length of time to wait for (in millis)excludeInternalFqns
- if true, any Fqns that are internal are excluded.public boolean lockAllAndRecord(Fqn fqn, LockType lockType, InvocationContext ctx)
LockManager
InvocationContext.addLock(Object)
.
The owner for the lock is determined by passing the invocation context to LockManager.getLockOwner(org.jboss.cache.InvocationContext)
.
fqn
- Node to locklockType
- type of lock to acquirectx
- invocation context associated with this invocationpublic boolean lockAllAndRecord(NodeSPI node, LockType lockType, InvocationContext ctx)
LockManager
InvocationContext.addLock(Object)
.
The owner for the lock is determined by passing the invocation context to LockManager.getLockOwner(org.jboss.cache.InvocationContext)
.
node
- Node to locklockType
- type of lock to acquirectx
- invocation context associated with this invocationpublic void unlockAll(NodeSPI node, Object owner)
LockManager
node
- node to unlockowner
- lock ownerpublic void unlockAll(NodeSPI node)
LockManager
node
- node to unlockpublic boolean ownsLock(Fqn fqn, LockType lockType, Object owner)
LockManager
fqn
- fqn to testlockType
- type of lock to test forowner
- ownerpublic boolean ownsLock(Fqn fqn, Object owner)
LockManager
fqn
- fqn to testowner
- ownerpublic boolean ownsLock(NodeSPI node, Object owner)
LockManager
node
- to testowner
- ownerpublic boolean isLocked(NodeSPI n)
LockManager
n
- node to inspectpublic boolean isLocked(Fqn fqn)
LockManager
fqn
- node to inspectpublic boolean isLocked(NodeSPI n, LockType type)
LockManager
n
- node to inspecttype
- lockType to test forpublic Object getWriteOwner(Fqn f)
LockManager
f
- Fqn to inspectpublic Collection<Object> getReadOwners(Fqn f)
LockManager
f
- Fqn to inspectpublic Object getWriteOwner(NodeSPI node)
LockManager
node
- the node to inspectpublic Collection<Object> getReadOwners(NodeSPI node)
LockManager
node
- the node to inspectpublic String printLockInfo(NodeSPI node)
LockManager
node
- node to inspectpublic String printLockInfo()
LockManager
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.