|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.mvcc.MVCCNodeHelper
public class MVCCNodeHelper
Utility functions to manipulate wrapping InternalNode
s as ReadCommittedNode
or RepeatableReadNode
s. Would also entail
locking, if necessary.
Constructor Summary | |
---|---|
MVCCNodeHelper()
|
Method Summary | |
---|---|
void |
injectDependencies(DataContainer dataContainer,
NodeFactory nodeFactory,
LockManager lockManager,
Configuration configuration)
|
void |
start()
|
NodeSPI |
wrapNodeForReading(InvocationContext ctx,
Fqn fqn,
boolean putInContext)
Similar to wrapNodesForReading(org.jboss.cache.InvocationContext, java.util.Collection) except that this
version takes a single Fqn parameter to wrap a single node. |
ReadCommittedNode |
wrapNodeForWriting(InvocationContext context,
Fqn fqn,
boolean lockForWriting,
boolean createIfAbsent,
boolean includeInvalidNodes,
boolean forRemoval,
boolean force)
First checks in contexts for the existence of the node. |
ReadCommittedNode |
wrapNodeForWriting(InvocationContext context,
Fqn fqn,
boolean lockForWriting,
boolean createIfAbsent,
boolean includeInvalidNodes,
boolean forRemoval,
boolean force,
boolean childIsNull)
|
NodeSPI |
wrapNodeForWriting(InvocationContext context,
InternalNode node,
InternalNode parent)
The same as wrapNodeForWriting(org.jboss.cache.InvocationContext, org.jboss.cache.Fqn, boolean, boolean,
boolean, boolean, boolean) except that it takes in an InternalNode instead of a Fqn . |
void |
wrapNodesForReading(InvocationContext ctx,
Collection<Fqn> fqns)
Attempts to provide the context with a set of wrapped nodes based on the Collection of fqns passed in. |
List<Fqn> |
wrapNodesRecursivelyForRemoval(InvocationContext ctx,
Fqn fqn)
Wraps a node and all its subnodes and adds them to the context, acquiring write locks for them all. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MVCCNodeHelper()
Method Detail |
---|
public void injectDependencies(DataContainer dataContainer, NodeFactory nodeFactory, LockManager lockManager, Configuration configuration)
public void start()
public void wrapNodesForReading(InvocationContext ctx, Collection<Fqn> fqns) throws InterruptedException
InternalNode
s are wrapped using NodeFactory.createWrappedNode(org.jboss.cache.InternalNode, org.jboss.cache.InternalNode)
and as such, null internal nodes are treated according to isolation level used.
See NodeFactory.createWrappedNode(org.jboss.cache.InternalNode, org.jboss.cache.InternalNode)
for details on this behaviour.
Note that if the context has the Option.isForceWriteLock()
option set, then write
locks are acquired and the node is copied.
ctx
- current invocation contextfqns
- collection of Fqns. Should not be null.
InterruptedException
- if write locks are forced and the lock manager is interrupted.public NodeSPI wrapNodeForReading(InvocationContext ctx, Fqn fqn, boolean putInContext) throws InterruptedException
wrapNodesForReading(org.jboss.cache.InvocationContext, java.util.Collection)
except that this
version takes a single Fqn parameter to wrap a single node.
ctx
- current invocation contextfqn
- fqn to fetch and wrapputInContext
-
InterruptedException
- if write locks are forced and the lock manager is interrupted.public ReadCommittedNode wrapNodeForWriting(InvocationContext context, Fqn fqn, boolean lockForWriting, boolean createIfAbsent, boolean includeInvalidNodes, boolean forRemoval, boolean force) throws InterruptedException
context
- invocation contextfqn
- to retrievelockForWriting
- if true, a lock will be acquired.createIfAbsent
- if true, will be created if absent.includeInvalidNodes
- if true, invalid nodes are included.forRemoval
- if true, the parent may also be locked if locking parents for removal is necessary.force
- if true, will force the write lock even if the node is null.
InterruptedException
- if interruptedpublic ReadCommittedNode wrapNodeForWriting(InvocationContext context, Fqn fqn, boolean lockForWriting, boolean createIfAbsent, boolean includeInvalidNodes, boolean forRemoval, boolean force, boolean childIsNull) throws InterruptedException
InterruptedException
public NodeSPI wrapNodeForWriting(InvocationContext context, InternalNode node, InternalNode parent) throws InterruptedException
wrapNodeForWriting(org.jboss.cache.InvocationContext, org.jboss.cache.Fqn, boolean, boolean,
boolean, boolean, boolean)
except that it takes in an InternalNode
instead of a Fqn
. Saves on a lookup.
Also assumes that the node exists, and hence will not be created.
context
- invocation contextnode
- node to wrap
InterruptedException
- if interruptedpublic List<Fqn> wrapNodesRecursivelyForRemoval(InvocationContext ctx, Fqn fqn) throws InterruptedException
ctx
- contextfqn
- fqn to wrap
InterruptedException
- if the lock manager is interrupted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |