org.apache.avalon.composition.model
Class DependencyGraph

java.lang.Object
  extended byorg.apache.avalon.composition.model.DependencyGraph

public class DependencyGraph
extends Object

Utility class to aquire an ordered graph of consumers and providers models.

Version:
$Revision: 1.3 $ $Date: 2004/01/24 23:25:25 $
Author:
Avalon Development Team

Constructor Summary
DependencyGraph()
          Creation of a new empty dependency graph.
DependencyGraph(DependencyGraph parent)
          Creation of a new dependecy graph holding a reference to a parent graph.
 
Method Summary
 void add(DeploymentModel model)
          Add a model to current dependency graph.
 void addChild(DependencyGraph child)
          Addition of a consumer dependency graph.
 DeploymentModel[] getConsumerGraph(DeploymentModel model)
          Get the serilized graph of DeploymentModel instances that use services of the specified model.
 DeploymentModel[] getProviderGraph(DeploymentModel model)
          Get the serilized graph of DeploymentModel istances that provide specified model with services.
 DeploymentModel[] getShutdownGraph()
          Get the serilized graph of DeploymentModel instances required when shutting down all the components.
 DeploymentModel[] getStartupGraph()
          Get the serilized graph of DeploymentModel objects required when starting up the target.
 void remove(DeploymentModel model)
          Remove a model from the dependency graph.
 void removeChild(DependencyGraph child)
          Removal of a consumer dependency graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyGraph

public DependencyGraph()
Creation of a new empty dependency graph.


DependencyGraph

public DependencyGraph(DependencyGraph parent)
Creation of a new dependecy graph holding a reference to a parent graph. DeploymentModel instances in the parent graph are potential providers for services if no model in current assembly satisfies a dependency.

Parameters:
parent - the parent graph
Method Detail

addChild

public void addChild(DependencyGraph child)
Addition of a consumer dependency graph.

Parameters:
child - the child map

removeChild

public void removeChild(DependencyGraph child)
Removal of a consumer dependency graph.

Parameters:
child - the child map

add

public void add(DeploymentModel model)
Add a model to current dependency graph.

Parameters:
model - the model to add to the graph

remove

public void remove(DeploymentModel model)
Remove a model from the dependency graph.

Parameters:
model - the model to remove

getStartupGraph

public DeploymentModel[] getStartupGraph()
Get the serilized graph of DeploymentModel objects required when starting up the target. This makes sure that all providers are established before their coresponding consumers in the graph.

Returns:
the ordered list of models

getShutdownGraph

public DeploymentModel[] getShutdownGraph()
Get the serilized graph of DeploymentModel instances required when shutting down all the components. This makes sure that all consumer shutdown actions occur before their coresponding providers in graph.

Returns:
the ordered list of model instances

getConsumerGraph

public DeploymentModel[] getConsumerGraph(DeploymentModel model)
Get the serilized graph of DeploymentModel instances that use services of the specified model.

Parameters:
model - the model
Returns:
the ordered list of consumer model instances

getProviderGraph

public DeploymentModel[] getProviderGraph(DeploymentModel model)
Get the serilized graph of DeploymentModel istances that provide specified model with services.

Parameters:
model - the model
Returns:
the ordered list of providers


Copyright © The Apache Software Foundation. All Rights Reserved.