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

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

public class NodeFactory<K,V>
extends ComponentFactory

Generates new nodes based on the CacheSPI configuration.

Author:
Manik Surtani (manik@jboss.org)

Nested Class Summary
static class NodeFactory.NodeType
           
 
Field Summary
 
Fields inherited from class org.jboss.cache.factories.ComponentFactory
componentRegistry, log
 
Constructor Summary
NodeFactory()
           
NodeFactory(CacheSPI<K,V> cache)
          Constructs an instance of the factory
 
Method Summary
protected
<T> T
construct(Class<T> componentType)
          Constructs a component.
 NodeSPI<K,V> createDataNode(Object childName, Fqn fqn, NodeSPI<K,V> parent, Map<K,V> data, boolean mapSafe)
          Creates a new Node instance.
 Node<K,V> createNode(Object childName, Node<K,V> parent, Map<K,V> data)
           
 Node<K,V> createNodeOfType(Node<K,V> template, Object childName, Node<K,V> parent, 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 org.jboss.cache.factories.ComponentFactory
assertTypeConstructable
 
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


NodeFactory

public NodeFactory()
Method Detail

construct

protected <T> T construct(Class<T> componentType)
Description copied from class: ComponentFactory
Constructs a component.

Specified by:
construct in class ComponentFactory
Parameters:
componentType - type of component
Returns:
a component

init

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


createDataNode

public NodeSPI<K,V> createDataNode(Object childName,
                                   Fqn fqn,
                                   NodeSPI<K,V> parent,
                                   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(Object childName,
                            Node<K,V> parent,
                            Map<K,V> data)

createNodeOfType

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

createWorkspaceNode

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

createRootDataNode

public NodeSPI<K,V> createRootDataNode()


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.