|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.invocation.AbstractInvocationDelegate org.jboss.cache.invocation.NodeInvocationDelegate org.jboss.cache.mvcc.ReadCommittedNode
public class ReadCommittedNode
A node delegate that encapsulates read committed semantics when writes are initiated, committed or rolled back.
Nested Class Summary | |
---|---|
protected static class |
ReadCommittedNode.Flags
|
Field Summary | |
---|---|
protected InternalNode |
backup
|
protected byte |
flags
|
protected InternalNode |
parent
|
Fields inherited from class org.jboss.cache.invocation.NodeInvocationDelegate |
---|
node |
Fields inherited from class org.jboss.cache.invocation.AbstractInvocationDelegate |
---|
componentRegistry, configuration, invocationContextContainer, invoker, originLocal |
Constructor Summary | |
---|---|
ReadCommittedNode(InternalNode node,
InternalNode parent)
|
Method Summary | |
---|---|
void |
commitUpdate(InvocationContext ctx,
DataContainer container)
Commits any updates made on this node to the underlying data structure, making it visible to all other transactions. |
InternalNode |
getInternalParent()
|
boolean |
isChanged()
Only used with MVCC. |
boolean |
isCreated()
Only used with MVCC. |
boolean |
isDeleted()
Returns true if the instance has been deleted in the current transaction. |
protected boolean |
isFlagSet(ReadCommittedNode.Flags flag)
Tests whether a flag is set. |
boolean |
isNullNode()
|
protected InternalNode |
lookupParent(Fqn fqn,
InvocationContext ctx,
DataContainer container)
Performs a lookup for the parent node of the Fqn passed in. |
void |
markAsDeleted(boolean deleted)
Marks the node as being deleted (or not) in the current transaction. |
void |
markAsDeleted(boolean deleted,
boolean recursive)
Same as NodeSPI.markAsDeleted(boolean) except that the option to recurse into children is provided. |
void |
markForUpdate(DataContainer container,
boolean writeSkewCheck)
Marks a node for updating. |
void |
rollbackUpdate()
Rolls back any changes made to a node. |
void |
setChildrenLoaded(boolean loaded)
Sets if the children of this node were loaded from a cache loader. |
void |
setCreated(boolean created)
Sets the created flag on a node. |
void |
setDataLoaded(boolean loaded)
Sets if the data was loaded from the cache loader. |
protected void |
setFlag(ReadCommittedNode.Flags flag)
Unility method that sets the value of the given flag to true. |
protected void |
unsetFlag(ReadCommittedNode.Flags flag)
Utility method that sets the value of the flag to false. |
protected void |
updateNode(Fqn fqn,
InvocationContext ctx,
DataContainer dataContainer)
Updates state changes on the current node in the underlying data structure. |
Methods inherited from class org.jboss.cache.invocation.AbstractInvocationDelegate |
---|
assertIsConstructed, initialize |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected volatile InternalNode backup
protected byte flags
protected InternalNode parent
Constructor Detail |
---|
public ReadCommittedNode(InternalNode node, InternalNode parent)
Method Detail |
---|
public InternalNode getInternalParent()
protected final boolean isFlagSet(ReadCommittedNode.Flags flag)
flag
- flag to test
protected final void setFlag(ReadCommittedNode.Flags flag)
flag
- flag to setprotected final void unsetFlag(ReadCommittedNode.Flags flag)
flag
- flag to unsetpublic boolean isNullNode()
isNullNode
in interface NodeSPI
isNullNode
in class NodeInvocationDelegate
public void markForUpdate(DataContainer container, boolean writeSkewCheck)
NodeSPI
markForUpdate
in interface NodeSPI
markForUpdate
in class NodeInvocationDelegate
container
- data containerwriteSkewCheck
- if true, and the node supports write skew checking, nodes are tested for write skews.public void commitUpdate(InvocationContext ctx, DataContainer container)
NodeSPI
commitUpdate
in interface NodeSPI
commitUpdate
in class NodeInvocationDelegate
ctx
- invocation contextcontainer
- data containerprotected final InternalNode lookupParent(Fqn fqn, InvocationContext ctx, DataContainer container) throws NodeNotExistsException
fqn
- Fqn whos parent to locatectx
- invocation contextcontainer
- data container
NodeNotExistsException
- if the parent node cannot be found in any scope or data container.protected void updateNode(Fqn fqn, InvocationContext ctx, DataContainer dataContainer)
ctx
- invocation contextdataContainer
- data containerpublic void rollbackUpdate()
NodeSPI
rollbackUpdate
in interface NodeSPI
rollbackUpdate
in class NodeInvocationDelegate
public boolean isChanged()
NodeSPI
isChanged
in interface NodeSPI
isChanged
in class NodeInvocationDelegate
public boolean isCreated()
NodeSPI
isCreated
in interface NodeSPI
isCreated
in class NodeInvocationDelegate
public void setCreated(boolean created)
NodeSPI
setCreated
in interface NodeSPI
setCreated
in class NodeInvocationDelegate
created
- flagpublic boolean isDeleted()
NodeSPI
isDeleted
in interface NodeSPI
isDeleted
in class NodeInvocationDelegate
public void markAsDeleted(boolean deleted)
NodeSPI
markAsDeleted
in interface NodeSPI
markAsDeleted
in class NodeInvocationDelegate
deleted
- true if the node has been deleted, false if not.public void markAsDeleted(boolean deleted, boolean recursive)
NodeSPI
NodeSPI.markAsDeleted(boolean)
except that the option to recurse into children is provided.
markAsDeleted
in interface NodeSPI
markAsDeleted
in class NodeInvocationDelegate
deleted
- true if the node has been deleted, false if not.recursive
- if true, child nodes (and their children) are marked as well.public void setChildrenLoaded(boolean loaded)
NodeSPI
setChildrenLoaded
in interface NodeSPI
setChildrenLoaded
in class NodeInvocationDelegate
loaded
- true if loaded, false otherwisepublic void setDataLoaded(boolean loaded)
NodeSPI
setDataLoaded
in interface NodeSPI
setDataLoaded
in class NodeInvocationDelegate
loaded
- true if loaded, false otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |