org.jboss.cache.optimistic
Interface TransactionWorkspace<K,V>

All Known Implementing Classes:
TransactionWorkspaceImpl

public interface TransactionWorkspace<K,V>

Used to contain a copy of the tree being worked on within the scope of a given transaction. Maintains WorkspaceNodes rather than conventional

Also see OptimisticTransactionEntry, which creates and maintains an instance of TransactionWorkspace for each transaction running.

Author:
Manik Surtani (manik@jboss.org), Steve Woodcock (stevew@jofti.com)

Method Summary
 void addNode(WorkspaceNode<K,V> node)
          Is thread safe so you dont need to deal with synchronising access to this method.
 void clearNodes()
          Empties the collection of nodes held by this workspace.
 WorkspaceNode<K,V> getNode(Fqn fqn)
           
 java.util.Map<Fqn,WorkspaceNode<K,V>> getNodes()
           
 java.util.SortedMap<Fqn,WorkspaceNode<K,V>> getNodesAfter(Fqn fqn)
          Returns all nodes equal to or after the given node.
 boolean hasNode(Fqn fqn)
          returns true if the workspace contains a node with specified Fqn
 boolean isVersioningImplicit()
          Tests if versioning is implicit for a given tx.
 WorkspaceNode<K,V> removeNode(Fqn fqn)
          Is thread safe so you dont need to deal with synchronising access to this method.
 void setNodes(java.util.Map<Fqn,WorkspaceNode<K,V>> nodes)
           
 void setVersioningImplicit(boolean versioningImplicit)
          Sets if versioning is implicit for a given tx.
 

Method Detail

getNodes

java.util.Map<Fqn,WorkspaceNode<K,V>> getNodes()
Returns:
Returns a map of WorkspaceNodes, keyed on Fqn

setNodes

void setNodes(java.util.Map<Fqn,WorkspaceNode<K,V>> nodes)
Parameters:
nodes - The nodes to set. Takes WorkspaceNodes.

getNode

WorkspaceNode<K,V> getNode(Fqn fqn)

addNode

void addNode(WorkspaceNode<K,V> node)
Is thread safe so you dont need to deal with synchronising access to this method.

Parameters:
node -

removeNode

WorkspaceNode<K,V> removeNode(Fqn fqn)
Is thread safe so you dont need to deal with synchronising access to this method.


getNodesAfter

java.util.SortedMap<Fqn,WorkspaceNode<K,V>> getNodesAfter(Fqn fqn)
Returns all nodes equal to or after the given node.


isVersioningImplicit

boolean isVersioningImplicit()
Tests if versioning is implicit for a given tx. If set to true, the interceptor chain will handle versioning (implicit to JBossCache). If set to false, DataVersions will have to come from the caller.


setVersioningImplicit

void setVersioningImplicit(boolean versioningImplicit)
Sets if versioning is implicit for a given tx. If set to true, the interceptor chain will handle versioning (implicit to JBossCache). If set to false, DataVersions will have to come from the caller.


hasNode

boolean hasNode(Fqn fqn)
returns true if the workspace contains a node with specified Fqn


clearNodes

void clearNodes()
Empties the collection of nodes held by this workspace.