Author: cziegeler
Date: Tue Feb 22 13:54:48 2005
New Revision: 154898

URL: http://svn.apache.org/viewcvs?view=rev&rev=154898
Log:
Correctly propagate component info

Modified:
    cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java
    
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java
    
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java
    
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java
    
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java
    
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java
    cocoon/trunk/src/java/org/apache/cocoon/cocoon.roles
    
cocoon/trunk/src/java/org/apache/cocoon/components/container/CocoonServiceManager.java
    
cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ComponentsSelector.java
    cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java
    cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java

Modified: 
cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java?view=diff&r1=154897&r2=154898
==============================================================================
--- cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java 
(original)
+++ cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java 
Tue Feb 22 13:54:48 2005
@@ -171,4 +171,17 @@
         this.setInitMethodName(attr.getAttribute("init", null));
         this.setDestroyMethodName(attr.getAttribute("destroy", null));
     }
+    
+    public ComponentInfo duplicate() {
+        ComponentInfo info = new ComponentInfo();
+        info.model = this.model;
+        info.initMethodName = this.initMethodName;
+        info.destroyMethodName = this.destroyMethodName;
+        info.poolInMethodName = this.poolInMethodName;
+        info.poolOutMethodName = this.poolOutMethodName;
+        info.serviceClassName = this.serviceClassName;
+        info.configuration = this.configuration;
+
+        return info;
+    }
 }

Modified: 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java?view=diff&r1=154897&r2=154898
==============================================================================
--- 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java
 (original)
+++ 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java
 Tue Feb 22 13:54:48 2005
@@ -100,14 +100,20 @@
     protected ComponentHandler getComponentHandler( final String role,
                                                     final Class componentClass,
                                                     final Configuration 
configuration,
-                                                    final ServiceManager 
serviceManager)
+                                                    final ServiceManager 
serviceManager,
+                                                    final ComponentInfo  
baseInfo)
     throws Exception {
         if (this.componentEnv == null) {
             this.componentEnv = new ComponentEnvironment(null, getLogger(), 
this.roleManager,
                     this.loggerManager, this.context, serviceManager);
         }
-        
-        ComponentInfo info = new ComponentInfo();
+        // FIXME - we should always get an info here
+        ComponentInfo info;
+        if ( baseInfo != null ) {
+            info = baseInfo.duplicate();
+        } else {
+            info = new ComponentInfo();
+        }
         info.setConfiguration(configuration);
         info.setServiceClassName(componentClass.getName());
         
@@ -118,7 +124,8 @@
 
     protected void addComponent(String className,
                                 String role,
-                                Configuration configuration) 
+                                Configuration configuration,
+                                ComponentInfo info) 
     throws ConfigurationException {
         // check for old excalibur class names - we only test against the 
selector
         // implementation
@@ -132,7 +139,7 @@
             }
             // FIXME - use different classloader
             final Class clazz = this.getClass().getClassLoader().loadClass( 
className );
-            this.addComponent( role, clazz, configuration );
+            this.addComponent( role, clazz, configuration, info );
         } catch( final ClassNotFoundException cnfe ) {
             final String message = "Could not get class (" + className + ") 
for role "
                                  + role + " at " + configuration.getLocation();
@@ -160,7 +167,10 @@
         }        
     }
     
-    protected abstract void addComponent(String role, Class clazz, 
Configuration config)
+    protected abstract void addComponent(String role, 
+                                         Class clazz, 
+                                         Configuration config,
+                                         ComponentInfo info)
     throws ServiceException;
     
     

Modified: 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java?view=diff&r1=154897&r2=154898
==============================================================================
--- 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java
 (original)
+++ 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/CoreServiceManager.java
 Tue Feb 22 13:54:48 2005
@@ -346,7 +346,8 @@
 
                         handler = this.getComponentHandler(role,
                                                        
info.getServiceClassName(),
-                                                       configuration);
+                                                       
configuration.getChild(role),
+                                                       info);
 
                         handler.initialize();
                     } catch (ServiceException se) {
@@ -458,7 +459,8 @@
      */
     public void addComponent( String role,
                               String className,
-                              Configuration configuration )
+                              Configuration configuration,
+                              ComponentInfo info)
     throws ConfigurationException {
         if( this.initialized ) {
             throw new IllegalStateException("Cannot add components to an 
initialized CoreServiceManager." );
@@ -482,7 +484,7 @@
         }
         
         try {
-            handler = this.getComponentHandler(role, className, configuration);
+            handler = this.getComponentHandler(role, className, configuration, 
info);
 
             if( this.getLogger().isDebugEnabled() ) {
                 this.getLogger().debug( "Handler type = " + 
handler.getClass().getName() );
@@ -585,10 +587,17 @@
      * @throws Exception If there were any problems obtaining a 
ComponentHandler
      */
     private ComponentHandler getComponentHandler( final String role,
-                                                    final String className,
-                                                    final Configuration 
configuration)
+                                                  final String className,
+                                                  final Configuration 
configuration,
+                                                  final ComponentInfo baseInfo)
     throws Exception {
-        ComponentInfo info = new ComponentInfo();
+        // FIXME - we should ensure that we always get an info
+        ComponentInfo info;
+        if ( baseInfo != null ) {
+            info = baseInfo.duplicate();
+        } else {
+            info = new ComponentInfo();
+        }
         info.setConfiguration(configuration);
         info.setServiceClassName(className);
         
@@ -645,7 +654,7 @@
                     role = role + "/" + name;
                 }
 
-                this.addComponent(role, className, componentConfig);
+                this.addComponent(role, className, componentConfig, null);
             }
         }
     }

Modified: 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java?view=diff&r1=154897&r2=154898
==============================================================================
--- 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java
 (original)
+++ 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/DefaultServiceSelector.java
 Tue Feb 22 13:54:48 2005
@@ -84,6 +84,7 @@
         for (int i = 0; i < instances.length; i++) {
 
             Configuration instance = instances[i];
+            ComponentInfo info = null;
 
             String key = instance.getAttribute("name");
 
@@ -93,7 +94,7 @@
             if (compInstanceName == null) {
                 // component-instance implicitly defined by the presence of 
the 'class' attribute
                 if (classAttr == null) {
-                    final ComponentInfo info = 
this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName());
+                    info = 
this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName());
                     className = info.getServiceClassName();
                 } else {
                     className = classAttr;
@@ -104,7 +105,7 @@
                 if (compInstanceName.equals(instance.getName())) {
                     className = (classAttr == null) ? null : classAttr;
                 } else {
-                    final ComponentInfo info = 
this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName());
+                    info = 
this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName());
                     className = info.getServiceClassName();
                 }
             }
@@ -118,7 +119,7 @@
             }
             
             // Add this component in the manager
-            this.manager.addComponent(this.rolePrefix + key, className, 
instance);
+            this.manager.addComponent(this.rolePrefix + key, className, 
instance, info);
         }
         
         // Register default key, if any

Modified: 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java?view=diff&r1=154897&r2=154898
==============================================================================
--- 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java
 (original)
+++ 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/StandaloneServiceSelector.java
 Tue Feb 22 13:54:48 2005
@@ -232,7 +232,8 @@
         for (int i = 0; i < instances.length; i++) {
 
             Configuration instance = instances[i];
-
+            ComponentInfo info = null;
+            
             String key = instance.getAttribute("name").trim();
 
             String classAttr = instance.getAttribute(getClassAttributeName(), 
null);
@@ -241,7 +242,7 @@
             if (compInstanceName == null) {
                 // component-instance implicitly defined by the presence of 
the 'class' attribute
                 if (classAttr == null) {
-                    final ComponentInfo info = 
this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName());
+                    info = 
this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName());
                     className = info.getServiceClassName();
                 } else {
                     className = classAttr.trim();
@@ -252,7 +253,7 @@
                 if (compInstanceName.equals(instance.getName())) {
                     className = (classAttr == null) ? null : classAttr.trim();
                 } else {
-                    final ComponentInfo info = 
this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName());
+                    info = 
this.roleManager.getDefaultServiceInfoForKey(roleName, instance.getName());
                     className = info.getServiceClassName();
                 }
             }
@@ -265,7 +266,7 @@
                 throw new ConfigurationException(message);
             }
             
-            this.addComponent( className, key, instance );
+            this.addComponent( className, key, instance, info );
         }
     }
 
@@ -336,7 +337,8 @@
      */
     public void addComponent( final String key,
                               final Class component,
-                              final Configuration configuration )
+                              final Configuration configuration,
+                              final ComponentInfo info)
     throws ServiceException {
         if( this.initialized ) {
             throw new ServiceException( key,
@@ -347,7 +349,8 @@
             final ComponentHandler handler = getComponentHandler( null,
                                                                   component,
                                                                   
configuration,
-                                                                  
this.serviceManager);
+                                                                  
this.serviceManager,
+                                                                  info);
 
             handler.initialize();
             this.componentHandlers.put( key, handler );

Modified: 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java?view=diff&r1=154897&r2=154898
==============================================================================
--- 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java
 (original)
+++ 
cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java
 Tue Feb 22 13:54:48 2005
@@ -97,9 +97,11 @@
 
         if( Poolable.class.isAssignableFrom( componentClass ) ) {
             numInterfaces++;
-            info.setModel(ComponentInfo.MODEL_POOLED);
-            if ( 
ComponentInfo.TYPE_NON_THREAD_SAFE_POOLED.equals(info.getConfiguration().getAttribute("model",
 null))) {
-                info.setModel(ComponentInfo.MODEL_NON_THREAD_SAFE_POOLED);
+            if ( info.getModel() != ComponentInfo.MODEL_NON_THREAD_SAFE_POOLED 
) {
+                info.setModel(ComponentInfo.MODEL_POOLED);
+                if ( 
ComponentInfo.TYPE_NON_THREAD_SAFE_POOLED.equals(info.getConfiguration().getAttribute("model",
 null))) {
+                    info.setModel(ComponentInfo.MODEL_NON_THREAD_SAFE_POOLED);
+                }
             }
         }
 

Modified: cocoon/trunk/src/java/org/apache/cocoon/cocoon.roles
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/cocoon.roles?view=diff&r1=154897&r2=154898
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/cocoon.roles (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/cocoon.roles Tue Feb 22 13:54:48 
2005
@@ -154,20 +154,160 @@
           
   <role name="org.apache.cocoon.components.notification.NotifyingBuilder"
         shorthand="notifying-builder"
-        
default-class="org.apache.cocoon.components.notification.DefaultNotifyingBuilder"/>
  
+        
default-class="org.apache.cocoon.components.notification.DefaultNotifyingBuilder"
+        
+               default-class CDATA #IMPLIED
+>
+<!ATTLIST hint shorthand CDATA #REQUIRED
+               class CDATA #REQUIRED
+>
+]>
+
+<role-list>
+
+  <role name="org.apache.excalibur.source.SourceFactorySelector"
+        shorthand="source-factories"
+        
default-class="org.apache.cocoon.core.container.DefaultServiceSelector">
+  </role>
+
+  <role name="org.apache.excalibur.source.SourceResolver"
+        shorthand="source-resolver"
+        
default-class="org.apache.cocoon.components.source.CocoonSourceResolver"/>
+
+  <!-- The entity resolver used by most parsers -->
+  <role name="org.apache.excalibur.xml.EntityResolver"
+        shorthand="entity-resolver"
+        default-class="org.apache.cocoon.components.resolver.DefaultResolver"/>
+
+  <!-- Parser:
+  
+       Starting with Cocoon 2.1 we have a bunch of different parser:
+       - a SAX parser (producing SAX events)
+       - a DOM parser (producint a document)
+       - an HTML parser (producing SAX events from an HTML document)
+       ...
+  -->
+
+  <!-- This is the usual SAX parser -->
+  <role name="org.apache.excalibur.xml.sax.SAXParser"
+        shorthand="xml-parser"
+        default-class="org.apache.excalibur.xml.impl.JaxpParser"/>
+
+  <!-- This is the usual DOM parser -->
+  <role name="org.apache.excalibur.xml.dom.DOMParser"
+        shorthand="dom-parser"
+        default-class="org.apache.excalibur.xml.impl.JaxpParser"/>
+
+  <!-- A Dom Serializer -->
+  <role default-class="org.apache.excalibur.xml.dom.DefaultDOMSerializer" 
name="org.apache.excalibur.xml.dom.DOMSerializer" shorthand="dom-serializer"/>
+
+  <!-- XSLT: -->
+  <role name="org.apache.excalibur.xml.xslt.XSLTProcessor"
+        shorthand="xslt-processor"
+        default-class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl"/>
+
+  <role name="org.apache.excalibur.xml.xpath.XPathProcessor"
+        shorthand="xpath-processor"
+        default-class="org.apache.excalibur.xml.xpath.XPathProcessorImpl"/>
+
+  <!-- Stores: -->
+  <role name="org.apache.excalibur.store.Store"
+       shorthand="store"
+       default-class="org.apache.cocoon.components.store.impl.EHDefaultStore"/>
+
+  <role name="org.apache.excalibur.store.Store/TransientStore"
+        shorthand="transient-store"
+        
default-class="org.apache.cocoon.components.store.impl.DefaultTransientStore"/>
+
+<!--
+  The persistent store is only an auxiliary store that shouldn't be
+  used by Cocoon users. It should only be used - if required - by
+  the Store. If we use JCS, we don't need a persistent store.
+  <role name="org.apache.excalibur.store.Store/PersistentStore"
+        shorthand="persistent-store"
+        
default-class="org.apache.cocoon.components.store.impl.DefaultPersistentStore"/>
+-->
+  <!-- Normally uses the org.apache.excalibur.store.impl.StoreJanitorImpl as
+       the default-class but as that uses its own Thread spawning there is
+       the org.apache.cocoon.components.store.impl.CocoonStoreJanitor class
+       to use a daemon thread from the 
org.apache.cocoon.components.thread.RunnableManager
+       component 
+       NOT: As soon as our patch has been accepted by the Excalibur community 
and an
+            excalibur-store has been release we can switch back to the 
original 
+            org.apache.excalibur.store.impl.StoreJanitorImpl class
+  -->
+  <role name="org.apache.excalibur.store.StoreJanitor"
+       shorthand="store-janitor"
+       
default-class="org.apache.cocoon.components.store.impl.CocoonStoreJanitor"/>
+
+  <!--=========================================================================
+       Sitemap engine
+      
=========================================================================-->
+
+  <!-- the sitemap engine -->
+  <role name="org.apache.cocoon.Processor"
+        shorthand="sitemap"
+        
default-class="org.apache.cocoon.components.treeprocessor.TreeProcessor"/>
+  
+  <!-- the tree builder for the sitemap language (additional implementations 
can be added here
+       or in cocoon.xconf for other implementations) -->
+  <role 
name="org.apache.cocoon.components.treeprocessor.TreeBuilder/sitemap-1.0"
+        
default-class="org.apache.cocoon.components.treeprocessor.sitemap.SitemapLanguage"/>
+
+  <!-- the various elements of map:components -->
+  <role name="org.apache.cocoon.components.pipeline.ProcessingPipelineSelector"
+        shorthand="pipes"
+        
default-class="org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector"/>
+
+  <role name="org.apache.cocoon.acting.ActionSelector"
+        shorthand="actions"
+        
default-class="org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector"/>
+      
+  <role name="org.apache.cocoon.selection.SelectorSelector"
+        shorthand="selectors"
+        
default-class="org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector"/>
+      
+  <role name="org.apache.cocoon.matching.MatcherSelector"
+        shorthand="matchers"
+        
default-class="org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector"/>
+      
+  <role name="org.apache.cocoon.generation.GeneratorSelector"
+        shorthand="generators"
+        
default-class="org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector"/>
+      
+  <role name="org.apache.cocoon.transformation.TransformerSelector"
+        shorthand="transformers"
+        
default-class="org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector"/>
+      
+  <role name="org.apache.cocoon.serialization.SerializerSelector"
+        shorthand="serializers"
+        
default-class="org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector"/>
+      
+  <role name="org.apache.cocoon.reading.ReaderSelector"
+        shorthand="readers"
+        
default-class="org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector"/>
+          
+  <role name="org.apache.cocoon.components.notification.NotifyingBuilder"
+        shorthand="notifying-builder"
+        
default-class="org.apache.cocoon.components.notification.DefaultNotifyingBuilder"
+        model="non-thread-safe-pooled"/>  
 
   <!-- system-defined sitemap components -->
   <role name="org.apache.cocoon.generation.Generator/&lt;notifier&gt;"
-        default-class="org.apache.cocoon.generation.NotifyingGenerator"/>
-  
+        default-class="org.apache.cocoon.generation.NotifyingGenerator"
+        model="non-thread-safe-pooled"/>
+        
   <role name="org.apache.cocoon.generation.Generator/&lt;aggregator&gt;"
-        default-class="org.apache.cocoon.sitemap.ContentAggregator"/>
+        default-class="org.apache.cocoon.sitemap.ContentAggregator"
+        model="non-thread-safe-pooled"/>
 
   <role name="org.apache.cocoon.transformation.Transformer/&lt;translator&gt;"
-        default-class="org.apache.cocoon.sitemap.LinkTranslator"/>
+        default-class="org.apache.cocoon.sitemap.LinkTranslator"
+        model="non-thread-safe-pooled"/>
 
   <role name="org.apache.cocoon.transformation.Transformer/&lt;gatherer&gt;"
-        default-class="org.apache.cocoon.sitemap.LinkGatherer"/>
+        default-class="org.apache.cocoon.sitemap.LinkGatherer"
+        model="non-thread-safe-pooled"/>
        
   
<!--=========================================================================-->
   

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/components/container/CocoonServiceManager.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/container/CocoonServiceManager.java?view=diff&r1=154897&r2=154898
==============================================================================
--- 
cocoon/trunk/src/java/org/apache/cocoon/components/container/CocoonServiceManager.java
 (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/container/CocoonServiceManager.java
 Tue Feb 22 13:54:48 2005
@@ -23,6 +23,7 @@
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.components.ComponentInfo;
 import org.apache.cocoon.components.SitemapConfigurable;
 import org.apache.cocoon.components.SitemapConfigurationHolder;
 import org.apache.cocoon.components.treeprocessor.ProcessorComponentInfo;
@@ -54,10 +55,10 @@
         this.info = new ProcessorComponentInfo(parentInfo);
     }
     
-    public void addComponent(String role, String clazz, Configuration config) 
throws ConfigurationException {
+    public void addComponent(String role, String clazz, Configuration config, 
ComponentInfo i) throws ConfigurationException {
         this.info.prepareConfig(role, clazz, config);
 
-        super.addComponent(role, clazz, config);
+        super.addComponent(role, clazz, config, i);
         // Let's ProcessorComponentInfo do its stuff.
         // Note: if more behaviours of this kind are needed, we may setup an
         // event listener mechanism on the core service manager

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ComponentsSelector.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ComponentsSelector.java?view=diff&r1=154897&r2=154898
==============================================================================
--- 
cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ComponentsSelector.java
 (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ComponentsSelector.java
 Tue Feb 22 13:54:48 2005
@@ -35,23 +35,6 @@
     private static final int GENERATOR   = 0;
     private static final int TRANSFORMER = 1;
     private static final int SERIALIZER  = 2;
-    private static final int READER      = 3;
-    private static final int MATCHER     = 4;
-    private static final int SELECTOR    = 5;
-    private static final int ACTION      = 6;
-    private static final int PIPELINE    = 7;
-
-//    /** Role names, ordered as the constants above */
-//    public static final String[] SELECTOR_ROLES = {
-//        Generator.ROLE   + "Selector",
-//        Transformer.ROLE + "Selector",
-//        Serializer.ROLE  + "Selector",
-//        Reader.ROLE      + "Selector",
-//        Matcher.ROLE     + "Selector",
-//        Selector.ROLE    + "Selector",
-//        Action.ROLE      + "Selector",
-//        ProcessingPipeline.ROLE + "Selector"
-//    };
 
     /** Configuration element names, used to find the role */
     private static final String[] CONFIG_NAMES = {
@@ -80,9 +63,6 @@
     /** The role as an integer */
     private int roleId;
 
-//    /** The set of known hints, used to add standard components (see 
ensureExists) */
-//    private Set knownHints = new HashSet();
-
     /**
      * Return the component instance name according to the selector role
      * (e.g. "action" for "org.apache.cocoon.acting.Action").
@@ -120,72 +100,6 @@
 
         super.configure(config);
     }
-
-//    /**
-//     * Add a component in this selector.
-//     */
-//    public void addComponent(String key, Class clazz, Configuration config) 
throws ServiceException {
-//        super.addComponent(key, clazz, config);
-//
-//        // Add to known hints. This is needed as we cannot call 
isSelectable() if initialize()
-//        // has not been called, and we cannot add components once it has 
been called...
-//        this.knownHints.add(key);
-//    }
-
-// Now defined in cocoon.roles
-//    /**
-//     * Ensure system-defined components exist (e.g. &lt;aggregator&gt;) and 
initialize
-//     * the selector.
-//     */
-//    public void initialize() throws Exception {
-//        DefaultConfiguration config = null;
-//
-//        // Ensure all system-defined hints exist.
-//        // NOTE : checking this here means they can be user-defined in the 
sitemap
-//        switch(this.roleId) {
-//            case GENERATOR :
-//                config = new 
DefaultConfiguration(COMPONENT_NAMES[GENERATOR], "autogenerated");
-//                config.setAttribute("name", "<notifier>");
-//                ensureExists("<notifier>",
-//                             
org.apache.cocoon.sitemap.NotifyingGenerator.class, config);
-//
-//                config = new 
DefaultConfiguration(COMPONENT_NAMES[GENERATOR], "autogenerated");
-//                config.setAttribute("name", "<aggregator>");
-//                ensureExists("<aggregator>",
-//                             
org.apache.cocoon.sitemap.ContentAggregator.class, config);
-//            break;
-//
-//            case TRANSFORMER :
-//                config = new 
DefaultConfiguration(COMPONENT_NAMES[TRANSFORMER], "autogenerated");
-//                config.setAttribute("name", "<translator>");
-//                ensureExists("<translator>",
-//                             org.apache.cocoon.sitemap.LinkTranslator.class, 
config);
-//
-//                config = new 
DefaultConfiguration(COMPONENT_NAMES[TRANSFORMER], "autogenerated");
-//                config.setAttribute("name", "<gatherer>");
-//                ensureExists("<gatherer>",
-//                             org.apache.cocoon.sitemap.LinkGatherer.class, 
config);
-//            break;
-//        }
-//
-//        super.initialize();
-//
-//        // Don't keep known hints (they're no more needed)
-//        this.knownHints = null;
-//    }
-//
-//    /**
-//     * Ensure a component exists or add it otherwhise. We cannot simply call 
hasComponent()
-//     * since it requires to be initialized, and we want to add components, 
and this must
-//     * be done before initialization.
-//     */
-//    private void ensureExists(String key, Class clazz, Configuration config) 
throws ServiceException {
-//        if (!this.knownHints.contains(key)) {
-//            if (this.parentSelector == null || 
!this.parentSelector.isSelectable(key)) {
-//                this.addComponent(key, clazz, config);
-//            }
-//        }
-//    }
 
     /**
      * Override parent to implement support for [EMAIL PROTECTED] 
GeneratorFactory},

Modified: cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java?view=diff&r1=154897&r2=154898
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/CocoonTestCase.java Tue Feb 22 
13:54:48 2005
@@ -53,12 +53,14 @@
             df.addChild(factory);
             
manager.addComponent("org.apache.excalibur.source.SourceFactorySelector", 
                                  StandaloneServiceSelector.class.getName(), 
-                                 df);
+                                 df,
+                                 null);
         }
         if ( this.addSourceResolver() ) {
             manager.addComponent(SourceResolver.ROLE, 
                     SourceResolverImpl.class.getName(), 
-                    new DefaultConfiguration("", "-"));
+                    new DefaultConfiguration("", "-"),
+                    null);
         }
     }
     

Modified: cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java
URL: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java?view=diff&r1=154897&r2=154898
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java 
(original)
+++ cocoon/trunk/src/test/org/apache/cocoon/SitemapComponentTestCase.java Tue 
Feb 22 13:54:48 2005
@@ -147,7 +147,8 @@
             df.addChild(factory);
             manager.addComponent(typeClassName + "Selector", 
                                  StandaloneServiceSelector.class.getName(), 
-                                 df);
+                                 df,
+                                 null);
         }
     }
 


Reply via email to