org.jboss.cache
Class NodeFactory<K,V>

java.lang.Object
  extended by org.jboss.cache.NodeFactory<K,V>

public class NodeFactory<K,V>
extends java.lang.Object

Generates new nodes based on the CacheSPI configuration.

Author:
Manik Surtani (manik@jboss.org)

Nested Class Summary
static class NodeFactory.NodeType
           
 
Constructor Summary
NodeFactory(CacheSPI<K,V> cache)
          Constructs an instance of the factory
 
Method Summary
 NodeSPI<K,V> createDataNode(java.lang.Object childName, Fqn fqn, NodeSPI<K,V> parent, java.util.Map<K,V> data, boolean mapSafe)
          Creates a new Node instance.
 Node<K,V> createNode(java.lang.Object childName, Node<K,V> parent, java.util.Map<K,V> data)
           
 Node<K,V> createNodeOfType(Node<K,V> template, java.lang.Object childName, Node<K,V> parent, java.util.Map<K,V> data)
           
 NodeSPI<K,V> createRootDataNode()
           
 WorkspaceNode<K,V> createWorkspaceNode(NodeSPI<K,V> dataNode, TransactionWorkspace workspace)
           
 void init()
          Initialises the node factory with the configuration from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeFactory

public NodeFactory(CacheSPI<K,V> cache)
Constructs an instance of the factory

Method Detail

init

public void init()
Initialises the node factory with the configuration from the cache.


createDataNode

public NodeSPI<K,V> createDataNode(java.lang.Object childName,
                                   Fqn fqn,
                                   NodeSPI<K,V> parent,
                                   java.util.Map<K,V> data,
                                   boolean mapSafe)
Creates a new Node instance.

Parameters:
childName - the new node's name
fqn - the new node's Fqn
parent - the new node's parent
data - the new node's attribute map
mapSafe - true if param data can safely be directly assigned to the new node's data field; false if param data's contents should be copied into the new node's data field.
Returns:
the new node

createNode

public Node<K,V> createNode(java.lang.Object childName,
                            Node<K,V> parent,
                            java.util.Map<K,V> data)

createNodeOfType

public Node<K,V> createNodeOfType(Node<K,V> template,
                                  java.lang.Object childName,
                                  Node<K,V> parent,
                                  java.util.Map<K,V> data)

createWorkspaceNode

public WorkspaceNode<K,V> createWorkspaceNode(NodeSPI<K,V> dataNode,
                                              TransactionWorkspace workspace)

createRootDataNode

public NodeSPI<K,V> createRootDataNode()