org.apache.avalon.activation.appliance
Class DependencyGraph

java.lang.Object
  extended byorg.apache.avalon.activation.appliance.DependencyGraph

public class DependencyGraph
extends Object

Utility class to help aquire a ordered graph of consumers and providers for specific components.

UML

Version:
$Revision: 1.1.1.1 $ $Date: 2003/09/10 08:57:34 $
Author:
Peter Donald, Stephen McConnell

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(Appliance appliance)
          Add an appliance to current dependency graph.
 void addChild(DependencyGraph child)
          Addition of a consumer dependency graph.
 Appliance[] getConsumerGraph(Appliance appliance)
          Get the serilized graph of Appliance objects that use services of the specified appliance.
 Appliance[] getProviderGraph(Appliance appliance)
          Get the serilized graph of Appliance objects that provide specified appliance with services.
 Appliance[] getShutdownGraph()
          Get the serilized graph of Appliance objects required when shutting down all the components.
 Appliance[] getStartupGraph()
          Get the serilized graph of Appliance objects required when starting up all the target.
 void remove(Appliance appliance)
          Remove an appliance 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. Appliance instances in the parent graph are potential providers for services if no appliance 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(Appliance appliance)
Add an appliance to current dependency graph.

Parameters:
appliance - the appliance

remove

public void remove(Appliance appliance)
Remove an appliance from the dependency graph.

Parameters:
appliance - the appliance

getStartupGraph

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

Returns:
the ordered list of appliances

getShutdownGraph

public Appliance[] getShutdownGraph()
Get the serilized graph of Appliance objects 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 appliance instances

getConsumerGraph

public Appliance[] getConsumerGraph(Appliance appliance)
Get the serilized graph of Appliance objects that use services of the specified appliance.

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

getProviderGraph

public Appliance[] getProviderGraph(Appliance appliance)
Get the serilized graph of Appliance objects that provide specified appliance with services.

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


Copyright © Apache Software Foundation. All Rights Reserved.