KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > kernel > DependencyManager


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 package org.apache.geronimo.kernel;
19
20 import org.apache.geronimo.gbean.AbstractName;
21
22 import java.util.Set JavaDoc;
23
24 /**
25  * DependencyManager is the record keeper of the dependencies in Geronimo. The DependencyManager
26  * does not enforce any dependencies, it is simply a place where components can register their intent
27  * to be dependent on another component.
28  * <p/>
29  * The DependencyManager uses the nomenclature of parent-child where a child is dependent on a parent.
30  * The names parent and child have no other meaning are just a convience to make the code readable.
31  *
32  * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
33  */

34 public interface DependencyManager {
35     /**
36      * Closes the dependency manager releasing all resources
37      */

38     public void close();
39
40     /**
41      * Declares a dependency from a child to a parent.
42      *
43      * @param child the dependent component
44      * @param parent the component the child is depending on
45      */

46     public void addDependency(AbstractName child, AbstractName parent);
47
48     /**
49      * Removes a dependency from a child to a parent
50      *
51      * @param child the dependnet component
52      * @param parent the component that the child wil no longer depend on
53      */

54     public void removeDependency(AbstractName child, AbstractName parent);
55
56     /**
57      * Removes all dependencies for a child
58      *
59      * @param child the component that will no longer depend on anything
60      */

61     public void removeAllDependencies(AbstractName child);
62
63     /**
64      * Adds dependencies from the child to every parent in the parents set
65      *
66      * @param child the dependent component
67      * @param parents the set of components the child is depending on
68      */

69     public void addDependencies(AbstractName child, Set JavaDoc parents);
70
71     /**
72      * Gets the set of parents that the child is depending on
73      *
74      * @param child the dependent component
75      * @return a collection containing all of the components the child depends on; will never be null
76      */

77     public Set JavaDoc getParents(AbstractName child);
78
79     /**
80      * Gets all of the MBeans that have a dependency on the specified startParent.
81      *
82      * @param parent the component the returned childen set depend on
83      * @return a collection containing all of the components that depend on the parent; will never be null
84      */

85     public Set JavaDoc getChildren(AbstractName parent);
86
87 }
88
Popular Tags