Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.cache.factories
Class NodeFactory

    java.lang.Object
      org.jboss.cache.factories.NodeFactory

    public class NodeFactory

extends java.lang.Object

A factory that generates nodes.

Author:
  Manik Surtani (manik@jboss.org)

Field Summary
`static byte` | `NODE_TYPE_OPTIMISTIC_NODE`
`static byte` | `NODE_TYPE_TREENODE`
`static byte` | `NODE_TYPE_WORKSPACE_NODE`

Method Summary
`DataNode` | `createDataNode(byte nodeType, java.lang.Object childName, Fqn fqn, DataNode parent, java.util.Map data, boolean mapSafe, TreeCache cache)` Returns a new data node.
`DataNode` | `createDataNode(byte nodeType, java.lang.Object childName, Fqn fqn, DataNode parent, java.util.Map data, boolean mapSafe, TreeCache cache, DataVersion version)` Creates a new `DataNode` instance.
`DataNode` | `createDataNode(byte nodeType, java.lang.Object childName, Fqn fqn, DataNode parent, java.util.Map data, TreeCache cache)` Returns a new data node.
`DataNode` | `createDataNode(byte nodeType, java.lang.Object childName, Fqn fqn, DataNode parent, java.util.Map data, TreeCache cache, DataVersion version)` Returns a new data node.
`TreeNode` | `createNodeOfType(TreeNode template, java.lang.Object childName, Fqn fqn, TreeNode parent, java.util.Map data, TreeCache cache)` Creates a node of the same type of the node passed in as a template.
`TreeNode` | `createNodeOfType(TreeNode template, java.lang.Object childName, Fqn fqn, TreeNode parent, java.util.Map data, TreeCache cache, DataVersion version)` same as above, passing in an explicit version
`DataNode` | `createRootDataNode(byte nodeType, TreeCache cache)` Returns a new root node.
`WorkspaceNode` | `createWorkspaceNode(TreeNode dataNode, TransactionWorkspace workspace)`
`static NodeFactory` | `getInstance()` Singleton accessor

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NODE_TYPE_TREENODE

    public static final byte NODE_TYPE_TREENODE

See Also:
  Constant Field Values

### NODE_TYPE_WORKSPACE_NODE

    public static final byte NODE_TYPE_WORKSPACE_NODE

See Also:
  Constant Field Values

### NODE_TYPE_OPTIMISTIC_NODE

    public static final byte NODE_TYPE_OPTIMISTIC_NODE

See Also:
  Constant Field Values

Method Detail

### getInstance

    public static NodeFactory getInstance()

  Singleton accessor

  Returns:
    a singleton instance of the NodeFactory

### createRootDataNode

    public DataNode createRootDataNode(byte nodeType,
                                       TreeCache cache)

  Returns a new root node.

### createDataNode

    public DataNode createDataNode(byte nodeType,
                                   java.lang.Object childName,
                                   Fqn fqn,
                                   DataNode parent,
                                   java.util.Map data,
                                   TreeCache cache,
                                   DataVersion version)

  Returns a new data node.

### createDataNode

    public DataNode createDataNode(byte nodeType,
                                   java.lang.Object childName,
                                   Fqn fqn,
                                   DataNode parent,
                                   java.util.Map data,
                                   TreeCache cache)

  Returns a new data node.

### createDataNode

    public DataNode createDataNode(byte nodeType,
                                   java.lang.Object childName,
                                   Fqn fqn,
                                   DataNode parent,
                                   java.util.Map data,
                                   boolean mapSafe,
                                   TreeCache cache)

  Returns a new data node.

### createDataNode

    public DataNode createDataNode(byte nodeType,
                                   java.lang.Object childName,
                                   Fqn fqn,
                                   DataNode parent,
                                   java.util.Map data,
                                   boolean mapSafe,
                                   TreeCache cache,
                                   DataVersion version)

  Creates a new `DataNode` instance.

  Parameters:
    `nodeType` - either `NODE_TYPE_TREENODE` or `NODE_TYPE_TREENODE`
    `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.
    `cache` - the cache to which the new node will be added
  Returns:
    the new node

### createNodeOfType

    public TreeNode createNodeOfType(TreeNode template,
                                     java.lang.Object childName,
                                     Fqn fqn,
                                     TreeNode parent,
                                     java.util.Map data,
                                     TreeCache cache)

  Creates a node of the same type of the node passed in as a template. The template passed in is entirely unaffected and is not related in any way to the new node except that they will share the same type.

  Parameters:
    `template` -
  Returns:
    TreeNode

### createNodeOfType

    public TreeNode createNodeOfType(TreeNode template,
                                     java.lang.Object childName,
                                     Fqn fqn,
                                     TreeNode parent,
                                     java.util.Map data,
                                     TreeCache cache,
                                     DataVersion version)

  same as above, passing in an explicit version

### createWorkspaceNode

    public WorkspaceNode createWorkspaceNode(TreeNode dataNode,
                                             TransactionWorkspace workspace)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1998-2005 JBoss Inc . All Rights Reserved.