consciouscode.seedling.config
Class ConfigBasedNodeProvider

java.lang.Object
  extended by consciouscode.seedling.config.ConfigBasedNodeProvider
All Implemented Interfaces:
NodeProvider

public class ConfigBasedNodeProvider
extends Object
implements NodeProvider

A NodeProvider that builds objects based on configuration in a ConfigTree.


Constructor Summary
ConfigBasedNodeProvider(ConfigTree configTree)
           
 
Method Summary
 void collectAvailableNodeNames(String branchPath, Collection<String> names)
          Builds a collection of the names of child nodes that are available for provisioning by this NodeProvider.
 NodeConfiguration getNodeConfiguration(NodeReference nodeRef)
          Gets the configuration for a specific node.
 Object provisionNode(NodeLocation location)
          Provisions a child of a given branch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigBasedNodeProvider

public ConfigBasedNodeProvider(ConfigTree configTree)
Method Detail

provisionNode

public Object provisionNode(NodeLocation location)
                     throws NodeInstantiationException
Provisions a child of a given branch. This is usually, but not necessarily, a new instance.

This provider acquires a NodeConfiguration from its ConfigTree to define the node.

Specified by:
provisionNode in interface NodeProvider
Parameters:
location - identifies where the node will be located.
Returns:
the provisioned node, or null if provisioning is not configured.
Throws:
NodeInstantiationException

collectAvailableNodeNames

public void collectAvailableNodeNames(String branchPath,
                                      Collection<String> names)
Description copied from interface: NodeProvider
Builds a collection of the names of child nodes that are available for provisioning by this NodeProvider.

Specified by:
collectAvailableNodeNames in interface NodeProvider
Parameters:
branchPath - indicates the branch for which child names are collected.
names - the collection into which child names will be added by this method. Must not be null.

getNodeConfiguration

public NodeConfiguration getNodeConfiguration(NodeReference nodeRef)
                                       throws ConfigurationException
Gets the configuration for a specific node.

Parameters:
nodeRef - must not be null.
Returns:
the configuration, or null if there is none.
Throws:
ConfigurationException - if there are problems loading the node's configuration.


Copyright © 2001–2012 Todd V. Jonker. All Rights Reserved.