--- C:\Home\leo\LOCALS~1\Temp\src.org.apache.cocoon.Cocoon_orig_4.java  Thu Aug 30 15:25:40 2001
+++ C:\Home\leo\private\Apache\xml-cocoon2\src\org\apache\cocoon\Cocoon.java    Thu Aug 30 14:23:10 2001
@@ -12,6 +12,8 @@
 import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.activity.Initializable;
 import org.apache.avalon.framework.component.Component;
+import org.apache.avalon.framework.component.ComponentManager;
+import org.apache.avalon.framework.component.Composable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
@@ -51,9 +53,10 @@
  *
  * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a> (Apache Software Foundation, Exoffice Technologies)
  * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
+ * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
  * @version CVS $Revision: 1.9.2.15 $ $Date: 2001/08/29 17:55:51 $
  */
-public class Cocoon extends AbstractLoggable implements ThreadSafe, Component, Initializable, Disposable, Modifiable, P
rocessor, Contextualizable {
+public class Cocoon extends AbstractLoggable implements ThreadSafe, Component, Initializable, Disposable, Modifiable, P
rocessor, Contextualizable, Composable {
     /** The application context */
     private Context context;

@@ -84,6 +87,9 @@
     /** The component manager. */
     public ExcaliburComponentManager componentManager;

+    /** The parent component manager. */
+    public ComponentManager parentComponentManager;
+
     /** flag for disposed or not */
     private boolean disposed = false;

@@ -93,6 +99,16 @@
         setSystemProperties();
     }

+    /**
+     * Get the parent component manager. For purposes of
+     * avoiding extra method calls, the manager parameter may be null.
+     *
+     * @param manager the parent component manager. May be <code>null</code>
+     */
+    public void compose(ComponentManager manager) {
+        this.parentComponentManager = manager;
+    }
+
     public void contextualize(Context context) throws ContextException {
         if (this.context == null) {
             this.context = context;
@@ -109,7 +125,8 @@
     }

     public void initialize() throws Exception {
-        this.componentManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
+        // Assuming that ExcaliburComponentManager(classLoader) == ExcaliburComponentManager(null, classLoader)
+        this.componentManager = new ExcaliburComponentManager(parentComponentManager,(ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
         this.componentManager.setLogger(getLogger());
         this.componentManager.contextualize(this.context);
