org.apache.geronimo.kernel.basic
Class BasicDependencyManager

java.lang.Object
  extended by org.apache.geronimo.kernel.basic.BasicDependencyManager
All Implemented Interfaces:
DependencyManager

public class BasicDependencyManager
extends Object
implements DependencyManager

DependencyManager is the record keeper of the dependencies in Geronimo. The DependencyManager does not enforce any dependencies, it is simply a place where components can register their intent to be dependent on another component. Since a JMX Component can pretty much do whatever it wants a component must watch the components it depends on to assure that they are following the J2EE-Management state machine.

The DependencyManager uses the nomenclature of parent-child where a child is dependent on a parent. The names parent and child have no other meaning are just a convience to make the code readable.


Constructor Summary
BasicDependencyManager(LifecycleMonitor lifecycleMonitor)
           
 
Method Summary
 void addDependencies(AbstractName child, Set parents)
          Adds dependencies from the child to every parent in the parents set
 void addDependency(AbstractName child, AbstractName parent)
          Declares a dependency from a child to a parent.
 void close()
          Closes the dependency manager releasing all resources
 Set getChildren(AbstractName parent)
          Gets all of the MBeans that have a dependency on the specified startParent.
 Set getParents(AbstractName child)
          Gets the set of parents that the child is depending on
 void removeAllDependencies(AbstractName child)
          Removes all dependencies for a child
 void removeDependency(AbstractName child, AbstractName parent)
          Removes a dependency from a child to a parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicDependencyManager

public BasicDependencyManager(LifecycleMonitor lifecycleMonitor)
                       throws Exception
Throws:
Exception
Method Detail

close

public void close()
Description copied from interface: DependencyManager
Closes the dependency manager releasing all resources

Specified by:
close in interface DependencyManager

addDependency

public void addDependency(AbstractName child,
                          AbstractName parent)
Declares a dependency from a child to a parent.

Specified by:
addDependency in interface DependencyManager
Parameters:
child - the dependent component
parent - the component the child is depending on

removeDependency

public void removeDependency(AbstractName child,
                             AbstractName parent)
Removes a dependency from a child to a parent

Specified by:
removeDependency in interface DependencyManager
Parameters:
child - the dependnet component
parent - the component that the child wil no longer depend on

removeAllDependencies

public void removeAllDependencies(AbstractName child)
Removes all dependencies for a child

Specified by:
removeAllDependencies in interface DependencyManager
Parameters:
child - the component that will no longer depend on anything

addDependencies

public void addDependencies(AbstractName child,
                            Set parents)
Adds dependencies from the child to every parent in the parents set

Specified by:
addDependencies in interface DependencyManager
Parameters:
child - the dependent component
parents - the set of components the child is depending on

getParents

public Set getParents(AbstractName child)
Gets the set of parents that the child is depending on

Specified by:
getParents in interface DependencyManager
Parameters:
child - the dependent component
Returns:
a collection containing all of the components the child depends on; will never be null

getChildren

public Set getChildren(AbstractName parent)
Gets all of the MBeans that have a dependency on the specified startParent.

Specified by:
getChildren in interface DependencyManager
Parameters:
parent - the component the returned childen set depend on
Returns:
a collection containing all of the components that depend on the parent; will never be null


Copyright © 2006 Apache Software Foundation. All Rights Reserved.