donaldp 2002/08/19 05:58:58
Modified: containerkit/src/java/org/apache/excalibur/containerkit/kernel
AbstractServiceKernel.java
containerkit/src/java/org/apache/excalibur/containerkit/dependency
DependencyMap.java
Log:
Made DependencyMap completely stateless.
Revision Changes Path
1.23 +6 -6
jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/AbstractServiceKernel.java
Index: AbstractServiceKernel.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/AbstractServiceKernel.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- AbstractServiceKernel.java 19 Aug 2002 12:30:42 -0000 1.22
+++ AbstractServiceKernel.java 19 Aug 2002 12:58:58 -0000 1.23
@@ -60,7 +60,7 @@
* The {@link DependencyMap} via which dependency graph is
* produced.
*/
- private final DependencyMap m_dependencyMap = new DependencyMap( m_store );
+ private final DependencyMap m_dependencyMap = new DependencyMap();
/**
* Initialization of the kernel. The implementation will request
@@ -125,7 +125,7 @@
protected final void startupAllComponents()
throws Exception
{
- final ComponentEntry[] components = m_dependencyMap.getStartupGraph();
+ final ComponentEntry[] components = m_dependencyMap.getStartupGraph(
m_store );
processComponents( true, components );
}
@@ -136,7 +136,7 @@
protected final void shutdownAllComponents()
throws Exception
{
- final ComponentEntry[] components = m_dependencyMap.getShutdownGraph();
+ final ComponentEntry[] components =
m_dependencyMap.getShutdownGraph(m_store);
processComponents( false, components );
}
@@ -150,7 +150,7 @@
{
final ComponentEntry entry = m_store.getComponent( name );
final ComponentEntry[] components =
- m_dependencyMap.getProviderGraph( entry );
+ m_dependencyMap.getProviderGraph( entry, m_store );
processComponents( true, components );
}
@@ -164,7 +164,7 @@
{
final ComponentEntry entry = m_store.getComponent( name );
final ComponentEntry[] components =
- m_dependencyMap.getConsumerGraph( entry );
+ m_dependencyMap.getConsumerGraph( entry, m_store );
processComponents( false, components );
}
1.16 +11 -20
jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/dependency/DependencyMap.java
Index: DependencyMap.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/dependency/DependencyMap.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DependencyMap.java 19 Aug 2002 12:53:40 -0000 1.15
+++ DependencyMap.java 19 Aug 2002 12:58:58 -0000 1.16
@@ -27,17 +27,6 @@
public class DependencyMap
{
/**
- * The set of components in assembly.
- * Used when searching for providers/consumers.
- */
- private final ComponentStore m_store;
-
- public DependencyMap( final ComponentStore store )
- {
- m_store = store;
- }
-
- /**
* Get the serilized graph of {@link ComponentEntry} objects
* required when starting up all the components. This makes sure
* that all providers occur before their coresponding
@@ -45,9 +34,9 @@
*
* @return the ordered list of components
*/
- public ComponentEntry[] getStartupGraph()
+ public ComponentEntry[] getStartupGraph( final ComponentStore store )
{
- return walkGraph( true, m_store );
+ return walkGraph( true, store );
}
/**
@@ -58,9 +47,9 @@
*
* @return the ordered list of components
*/
- public ComponentEntry[] getShutdownGraph()
+ public ComponentEntry[] getShutdownGraph( final ComponentStore store )
{
- return walkGraph( false, m_store );
+ return walkGraph( false, store );
}
/**
@@ -70,9 +59,10 @@
* @param component the component
* @return the ordered list of consumers
*/
- public ComponentEntry[] getConsumerGraph( final ComponentEntry component )
+ public ComponentEntry[] getConsumerGraph( final ComponentEntry component,
+ final ComponentStore store )
{
- return getComponentGraph( component, false, m_store );
+ return getComponentGraph( component, false, store );
}
/**
@@ -82,9 +72,10 @@
* @param component the component
* @return the ordered list of providers
*/
- public ComponentEntry[] getProviderGraph( final ComponentEntry component )
+ public ComponentEntry[] getProviderGraph( final ComponentEntry component,
+ final ComponentStore store )
{
- return getComponentGraph( component, true, m_store );
+ return getComponentGraph( component, true, store );
}
/**
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>