|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectconsciouscode.seedling.tree.GenericNode
consciouscode.seedling.tree.GenericBranch
consciouscode.seedling.tree.StandardBranch
public class StandardBranch
The canonical implementation of BranchNode, providing dynamic node
provisioning via a NodeProvider.
| Field Summary | |
|---|---|
protected NodeProvider |
myNodeProvider
|
| Constructor Summary | |
|---|---|
StandardBranch()
Constructs a new branch, inheriting its NodeProvider from its
parent branch. |
|
StandardBranch(NodeProvider nodeProvider)
|
|
| Method Summary | |
|---|---|
Collection<String> |
availableChildNames()
Extracts a collection of the names of child nodes that are available on request from this branch. |
protected StandardBranch |
constructChildBranch()
Strategy method called by GenericBranch.provisionChildBranch() to do
initial construction of child branches. |
NodeProvider |
getNodeProvider()
Returns the object responsible for provisioning nodes for this branch. |
void |
nodeInstalled(NodeLocation location)
Register the Seedling address at which this node has been installed. |
protected Object |
provisionChild(String nodeName)
Attempts to provision a child node, where one doesn't currently exist. |
| Methods inherited from class consciouscode.seedling.tree.GenericBranch |
|---|
addBranchChangeListener, availableChild, createChild, fireChildInstalled, fireChildUninstalled, getChild, getInstalledNode, getLocalPathForChild, getLocalRoot, getNode, installChild, installedChild, installedChildNames, provisionChildBranch, startService, stopService, uninstallChild |
| Methods inherited from class consciouscode.seedling.tree.GenericNode |
|---|
getLog, getNodeLocation, getNodeName, getParentBranch, isLoggingDebug, setLog, setLoggingDebug |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface consciouscode.seedling.BranchingBranch |
|---|
provisionChildBranch |
| Methods inherited from interface consciouscode.seedling.GrowingBranch |
|---|
installChild, uninstallChild |
| Methods inherited from interface consciouscode.seedling.BranchNode |
|---|
availableChild, getChild, getInstalledNode, getLocalRoot, getLog, getNode, installedChild, installedChildNames |
| Methods inherited from interface consciouscode.seedling.LocatableNode |
|---|
getNodeLocation |
| Methods inherited from interface consciouscode.seedling.ServiceNode |
|---|
startService, stopService |
| Field Detail |
|---|
protected NodeProvider myNodeProvider
| Constructor Detail |
|---|
public StandardBranch()
NodeProvider from its
parent branch.
This can only be installed inside another instance of
StandardBranch.
nodeInstalled(NodeLocation)public StandardBranch(NodeProvider nodeProvider)
| Method Detail |
|---|
public NodeProvider getNodeProvider()
public Collection<String> availableChildNames()
BranchNodeThe result is a snapshot of the current state: subsequent changes to the branch are not reflected in the result. Thus the actual children may have changed by the time the collection is inspected; in particular, another thread may uninstall a node named in this collection (thereby making it unavailable) before the name is even read from this collection.
Implementations must ensure that the result stays usable even when the
branch changes in another thread. For example, iterating the result
must not throw ConcurrentModificationException if the branch
changes during iteration.
availableChildNames in interface BranchNodeavailableChildNames in class GenericBranchpublic void nodeInstalled(NodeLocation location)
GenericBranch
Note: This is not called setNodeLocation because
the location is not intended as a writable property.
This implementation calls super and then caches the location's
local root.
nodeInstalled in interface LocatableNodenodeInstalled in class GenericBranchlocation - is this node's new location. It must not be null.GenericBranch.getLocalRoot()protected StandardBranch constructChildBranch()
GenericBranchGenericBranch.provisionChildBranch() to do
initial construction of child branches.
Subclasses will generally override this to construct a new instance of
their own class.
constructChildBranch in class GenericBranchGenericBranch.GenericBranch.provisionChildBranch()
protected Object provisionChild(String nodeName)
throws NodeProvisioningException
GenericBranch
This implementation always returns null.
provisionChild in class GenericBranchnull if the node is
not available.
NodeProvisioningException - if there's a problem provisioning the
node.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||