cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.2/src/java/org/apache/cocoon/components/pipeline OutputComponentSelector.java ProcessingPipeline.java AbstractProcessingPipeline.java
Date Mon, 27 Oct 2003 08:09:37 GMT
cziegeler    2003/10/27 00:09:37

  Modified:    src/java/org/apache/cocoon/components/pipeline/impl
                        CachingPointProcessingPipeline.java
                        AbstractCachingProcessingPipeline.java
                        CachingProcessingPipeline.java
                        BaseCachingProcessingPipeline.java
               src/java/org/apache/cocoon/components/pipeline
                        OutputComponentSelector.java
                        ProcessingPipeline.java
                        AbstractProcessingPipeline.java
  Log:
  Moving to Serviceable - a little bit
  
  Revision  Changes    Path
  1.5       +6 -6      cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/impl/CachingPointProcessingPipeline.java
  
  Index: CachingPointProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/impl/CachingPointProcessingPipeline.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CachingPointProcessingPipeline.java	28 Aug 2003 06:09:29 -0000	1.4
  +++ CachingPointProcessingPipeline.java	27 Oct 2003 08:09:36 -0000	1.5
  @@ -50,11 +50,11 @@
   */
   package org.apache.cocoon.components.pipeline.impl;
   
  -import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.framework.service.ServiceException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.caching.CachedResponse;
   import org.apache.cocoon.caching.CachingOutputStream;
  @@ -425,7 +425,7 @@
                       this.connect(environment, prev, next);
                   }
   
  -            } catch ( ComponentException e ) {
  +            } catch ( ServiceException e ) {
                   throw new ProcessingException("Could not connect pipeline.", e);
               }
       }
  @@ -434,12 +434,12 @@
       /**
        * Recyclable Interface
        */
  -    public void recycle() {
  -        super.recycle();
  +    public void reset() {
  +        super.reset();
   
           Iterator itt = this.xmlSerializerArray.iterator();
           while (itt.hasNext()) {
  -            this.manager.release((XMLSerializer) itt.next());
  +            this.manager.release(itt.next());
           }
           this.isCachePoint.clear();
           this.xmlSerializerArray.clear();
  
  
  
  1.16      +3 -3      cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
  
  Index: AbstractCachingProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- AbstractCachingProcessingPipeline.java	15 Oct 2003 18:03:53 -0000	1.15
  +++ AbstractCachingProcessingPipeline.java	27 Oct 2003 08:09:36 -0000	1.16
  @@ -896,7 +896,7 @@
       /**
        * Recyclable Interface
        */
  -    public void recycle() {
  +    public void reset() {
   
           this.generatorRole = null;
           this.transformerRoles.clear();
  @@ -909,7 +909,7 @@
           this.toCacheKey = null;
           this.toCacheSourceValidities = null;
   
  -        super.recycle();
  +        super.reset();
       }
   
   }
  
  
  
  1.4       +3 -3      cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/impl/CachingProcessingPipeline.java
  
  Index: CachingProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/impl/CachingProcessingPipeline.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CachingProcessingPipeline.java	7 Aug 2003 08:52:15 -0000	1.3
  +++ CachingProcessingPipeline.java	27 Oct 2003 08:09:36 -0000	1.4
  @@ -50,7 +50,7 @@
   */
   package org.apache.cocoon.components.pipeline.impl;
   
  -import org.apache.avalon.framework.component.ComponentException;
  +import org.apache.avalon.framework.service.ServiceException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.caching.CachedResponse;
   import org.apache.cocoon.caching.CachingOutputStream;
  @@ -173,7 +173,7 @@
                       this.connect(environment, prev, next);
                   }
   
  -            } catch ( ComponentException e ) {
  +            } catch ( ServiceException e ) {
                   throw new ProcessingException("Could not connect pipeline.", e);
               }
       }
  
  
  
  1.2       +5 -5      cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/impl/BaseCachingProcessingPipeline.java
  
  Index: BaseCachingProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/impl/BaseCachingProcessingPipeline.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseCachingProcessingPipeline.java	31 Jul 2003 12:39:04 -0000	1.1
  +++ BaseCachingProcessingPipeline.java	27 Oct 2003 08:09:36 -0000	1.2
  @@ -51,9 +51,9 @@
   package org.apache.cocoon.components.pipeline.impl;
   
   import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.parameters.ParameterException;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.framework.service.ServiceException;
   import org.apache.cocoon.caching.Cache;
   import org.apache.cocoon.components.pipeline.AbstractProcessingPipeline;
   import org.apache.cocoon.components.sax.XMLDeserializer;
  @@ -94,7 +94,7 @@
           
           try {
               this.cache = (Cache)this.manager.lookup(cacheRole);
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new ParameterException("Unable to lookup cache: " + cacheRole, ce);
           }
       }
  @@ -102,14 +102,14 @@
       /**
        * Recyclable Interface
        */
  -    public void recycle() {
  +    public void reset() {
           this.manager.release( this.xmlDeserializer );
           this.xmlDeserializer = null;
   
           this.manager.release( this.xmlSerializer );
           this.xmlSerializer = null;
   
  -        super.recycle();
  +        super.reset();
       }
   
       /**
  
  
  
  1.2       +3 -3      cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/OutputComponentSelector.java
  
  Index: OutputComponentSelector.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/OutputComponentSelector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- OutputComponentSelector.java	9 Mar 2003 00:09:07 -0000	1.1
  +++ OutputComponentSelector.java	27 Oct 2003 08:09:36 -0000	1.2
  @@ -50,7 +50,7 @@
   */
   package org.apache.cocoon.components.pipeline;
   
  -import org.apache.avalon.framework.component.ComponentSelector;
  +import org.apache.avalon.framework.service.ServiceSelector;
   
   /**
    * A <code>ComponentSelector</code> for output components used by a {@link
ProcessingPipeline}.
  @@ -60,7 +60,7 @@
    * @version CVS $Id$
    */
   
  -public interface OutputComponentSelector extends ComponentSelector {
  +public interface OutputComponentSelector extends ServiceSelector {
   
       /**
        * Get the MIME type for a given hint.
  
  
  
  1.4       +2 -3      cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/ProcessingPipeline.java
  
  Index: ProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/ProcessingPipeline.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProcessingPipeline.java	30 May 2003 09:23:14 -0000	1.3
  +++ ProcessingPipeline.java	27 Oct 2003 08:09:36 -0000	1.4
  @@ -50,7 +50,6 @@
   */
   package org.apache.cocoon.components.pipeline;
   
  -import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.Recomposable;
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.cocoon.ProcessingException;
  @@ -82,7 +81,7 @@
    * @version CVS $Id$
    */
   public interface ProcessingPipeline
  -       extends   Component, Recomposable {
  +       extends   Recomposable {
   
       String ROLE = ProcessingPipeline.class.getName();
   
  
  
  
  1.11      +30 -28    cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
  
  Index: AbstractProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AbstractProcessingPipeline.java	19 Oct 2003 16:12:54 -0000	1.10
  +++ AbstractProcessingPipeline.java	27 Oct 2003 08:09:36 -0000	1.11
  @@ -58,15 +58,16 @@
   import java.util.NoSuchElementException;
   import java.util.StringTokenizer;
   
  -import org.apache.avalon.excalibur.pool.Recyclable;
  -import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.ComponentSelector;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.parameters.ParameterException;
   import org.apache.avalon.framework.parameters.Parameterizable;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.ServiceSelector;
  +import org.apache.avalon.framework.service.Serviceable;
   import org.apache.cocoon.ConnectionResetException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.Processor;
  @@ -80,6 +81,7 @@
   import org.apache.cocoon.transformation.Transformer;
   import org.apache.cocoon.xml.XMLConsumer;
   import org.apache.cocoon.xml.XMLProducer;
  +import org.apache.excalibur.mpool.Resettable;
   import org.apache.excalibur.source.SourceValidity;
   import org.xml.sax.SAXException;
   
  @@ -92,13 +94,13 @@
    */
   public abstract class AbstractProcessingPipeline
     extends AbstractLogEnabled
  -  implements ProcessingPipeline, Parameterizable, Recyclable {
  +  implements ProcessingPipeline, Parameterizable, Resettable, Serviceable {
   
       // Generator stuff
       protected Generator generator;
       protected Parameters generatorParam;
       protected String generatorSource;
  -    protected ComponentSelector generatorSelector;
  +    protected ServiceSelector generatorSelector;
   
       // Transformer stuff
       protected ArrayList transformers = new ArrayList();
  @@ -127,11 +129,11 @@
        */
       protected XMLConsumer lastConsumer;
   
  -    /** the component manager set with compose() */
  -    protected ComponentManager manager;
  +    /** the component manager set with service() */
  +    protected ServiceManager manager;
   
  -    /** the component manager set with compose() and recompose() */
  -    protected ComponentManager newManager;
  +    /** the component manager set with service() and recompose() */
  +    protected ServiceManager newManager;
   
       /** The configuration */
       protected Parameters configuration;
  @@ -155,10 +157,10 @@
       protected Processor processor;
       
       /**
  -     * Composable Interface
  +     * Serviceable Interface
        */
  -    public void compose (ComponentManager manager)
  -    throws ComponentException {
  +    public void service(ServiceManager manager)
  +    throws ServiceException {
           this.manager = manager;
           this.newManager = manager;
       }
  @@ -248,13 +250,13 @@
               throw new ProcessingException ("Reader already set. You cannot use a reader
and a generator for one pipeline.");
           }
           try {
  -            this.generatorSelector = (ComponentSelector) this.newManager.lookup(Generator.ROLE
+ "Selector");
  -        } catch (ComponentException ce) {
  +            this.generatorSelector = (ServiceSelector) this.newManager.lookup(Generator.ROLE
+ "Selector");
  +        } catch (ServiceException ce) {
               throw new ProcessingException("Lookup of generator selector failed.", ce);
           }
           try {
               this.generator = (Generator) this.generatorSelector.select(role);
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new ProcessingException("Lookup of generator for role '"+role+"' failed.",
ce);
           }
           this.generatorSource = source;
  @@ -281,16 +283,16 @@
           if (this.generator == null) {
               throw new ProcessingException ("You must set a generator first before you can
use a transformer.");
           }
  -        ComponentSelector selector = null;
  +        ServiceSelector selector = null;
           try {
  -            selector = (ComponentSelector) this.newManager.lookup(Transformer.ROLE + "Selector");
  -        } catch (ComponentException ce) {
  +            selector = (ServiceSelector) this.newManager.lookup(Transformer.ROLE + "Selector");
  +        } catch (ServiceException ce) {
               throw new ProcessingException("Lookup of transformer selector failed.", ce);
           }
           try {
               this.transformers.add(selector.select(role));
               this.transformerSelectors.add(selector);
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new ProcessingException("Lookup of transformer for role '"+role+"' failed.",
ce);
           }
           this.transformerSources.add(source);
  @@ -315,12 +317,12 @@
   
           try {
               this.serializerSelector = (OutputComponentSelector) this.newManager.lookup(Serializer.ROLE
+ "Selector");
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new ProcessingException("Lookup of serializer selector failed.", ce);
           }
           try {
               this.serializer = (Serializer)serializerSelector.select(role);
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new ProcessingException("Lookup of serializer for role '"+role+"' failed.",
ce);
           }
           this.serializerSource = source;
  @@ -345,12 +347,12 @@
   
           try {
               this.readerSelector = (OutputComponentSelector) this.newManager.lookup(Reader.ROLE
+ "Selector");
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new ProcessingException("Lookup of reader selector failed.", ce);
           }
           try {
               this.reader = (Reader)readerSelector.select(role);
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new ProcessingException("Lookup of reader for role '"+role+"' failed.",
ce);
           }
           this.readerSource = source;
  @@ -632,7 +634,7 @@
           return true;
       }
   
  -    public void recycle() {
  +    public void reset() {
           // release reader.
           if ( this.readerSelector != null) {
               this.readerSelector.release(this.reader);
  @@ -654,9 +656,9 @@
           // Release transformers
           int size = this.transformerSelectors.size();
           for (int i = 0; i < size; i++) {
  -            final ComponentSelector selector =
  -                (ComponentSelector)this.transformerSelectors.get(i);
  -            selector.release( (Component)this.transformers.get(i) );
  +            final ServiceSelector selector =
  +                (ServiceSelector)this.transformerSelectors.get(i);
  +            selector.release( this.transformers.get(i) );
               this.newManager.release( selector );
           }
           this.transformerSelectors.clear();
  
  
  

Mime
View raw message