You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2003/10/21 14:45:12 UTC

cvs commit: cocoon-2.2/src/java/org/apache/cocoon/transformation CIncludeTransformer.java SourceWritingTransformer.java AbstractSAXTransformer.java

cziegeler    2003/10/21 05:45:12

  Modified:    src/java/org/apache/cocoon/transformation
                        CIncludeTransformer.java
                        SourceWritingTransformer.java
                        AbstractSAXTransformer.java
  Log:
  Moving to Serviceable
  
  Revision  Changes    Path
  1.8       +14 -15    cocoon-2.2/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
  
  Index: CIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CIncludeTransformer.java	16 Oct 2003 15:00:37 -0000	1.7
  +++ CIncludeTransformer.java	21 Oct 2003 12:45:12 -0000	1.8
  @@ -52,10 +52,9 @@
   
   import org.apache.excalibur.xml.xpath.XPathProcessor;
   import org.apache.avalon.framework.activity.Disposable;
  -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.parameters.Parameters;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.caching.CacheableProcessingComponent;
   import org.apache.cocoon.components.sax.XMLDeserializer;
  @@ -230,11 +229,11 @@
       }
   
       /**
  -     * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
  +     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
        */
  -    public void compose(ComponentManager manager) throws ComponentException {
  -        super.compose(manager);
  -        if ( this.manager.hasComponent( IncludeCacheManager.ROLE )) {
  +    public void service(ServiceManager manager) throws ServiceException {
  +        super.service(manager);
  +        if ( this.manager.hasService( IncludeCacheManager.ROLE )) {
               this.cacheManager = (IncludeCacheManager) this.manager.lookup( IncludeCacheManager.ROLE );
           } else {
               this.getLogger().warn("The cinclude transformer cannot find the IncludeCacheManager. Therefore caching is turned off for the include transformer.");
  @@ -246,7 +245,7 @@
        */
       public void dispose() {
           if ( null != this.manager ) {
  -            this.manager.release( (Component)this.cacheManager );
  +            this.manager.release(this.cacheManager );
               this.manager = null;
           }
       }
  @@ -393,7 +392,7 @@
                       }
                   } catch (ProcessingException pe) {
                       if (!ignoreErrors) throw pe;
  -                } catch (ComponentException ignore) {
  +                } catch (ServiceException ignore) {
                   } finally {
                       this.manager.release( serializer );
                       this.manager.release( deserializer );
  @@ -551,8 +550,8 @@
                                                  this);
                       }
                   } finally {
  -                    this.manager.release((Component)parser);
  -                    this.manager.release((Component)processor);
  +                    this.manager.release(parser);
  +                    this.manager.release(processor);
                   }
               } else {
                   String mimeType = null;
  @@ -573,7 +572,7 @@
               throw new SAXException("CIncludeTransformer could not read resource", e);
           } catch (ProcessingException e){
               throw new SAXException("Exception in CIncludeTransformer",e);
  -        } catch(ComponentException e) {
  +        } catch(ServiceException e) {
               throw new SAXException(e);
           } finally {
               this.resolver.release(source);
  @@ -605,7 +604,7 @@
   
               this.addRecorder(recorder);
   
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               throw new SAXException("Unable to lookup xml serializer for compiling xml.", ce);
           }
           if (this.getLogger().isDebugEnabled()) {
  @@ -651,7 +650,7 @@
                   deserializer = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
                   deserializer.setConsumer(this.filter);
                   deserializer.deserialize(compiledXML);
  -            } catch (ComponentException ce) {
  +            } catch (ServiceException ce) {
                   throw new SAXException("Unable to lookup xml deserializer.", ce);
               } finally {
                   this.manager.release( deserializer );
  
  
  
  1.8       +8 -9      cocoon-2.2/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java
  
  Index: SourceWritingTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SourceWritingTransformer.java	23 Sep 2003 12:26:58 -0000	1.7
  +++ SourceWritingTransformer.java	21 Oct 2003 12:45:12 -0000	1.8
  @@ -54,12 +54,11 @@
   import java.io.OutputStream;
   import java.util.Map;
   
  -import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentSelector;
   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.avalon.framework.service.ServiceSelector;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.source.SourceUtil;
   import org.apache.cocoon.environment.SourceResolver;
  @@ -667,7 +666,7 @@
                                       try {
                                           resource = parser.createDocument();
                                       } finally {
  -                                        this.manager.release( (Component)parser );
  +                                        this.manager.release(parser );
                                       }
   
                                       resource.appendChild(resource.importNode(importNode, true));
  @@ -706,7 +705,7 @@
                   try {
                       resource = parser.createDocument();
                   } finally {
  -                    this.manager.release( (Component)parser );
  +                    this.manager.release( parser );
                   }
                   // import the fragment
                   Node importNode = resource.importNode(fragment, true);
  @@ -733,11 +732,11 @@
                   if (localSerializer == null) localSerializer = this.configuredSerializerName;
                   if (localSerializer != null) {
                       // Lookup the Serializer
  -                    ComponentSelector selector = null;
  +                    ServiceSelector selector = null;
                       Serializer serializer = null;
                       OutputStream oStream = null;
                       try {
  -                        selector = (ComponentSelector)manager.lookup(Serializer.ROLE + "Selector");
  +                        selector = (ServiceSelector)manager.lookup(Serializer.ROLE + "Selector");
                           serializer = (Serializer)selector.select(localSerializer);
                           oStream = ws.getOutputStream();
                           serializer.setOutputStream(oStream);
  @@ -775,7 +774,7 @@
                   getLogger().debug("FAIL exception: "+de, de);
               }
               message = "There was a problem manipulating your document: " + de;
  -        } catch (ComponentException ce) {
  +        } catch (ServiceException ce) {
               if (getLogger().isDebugEnabled()) {
                   getLogger().debug("FAIL exception: "+ce, ce);
               }
  
  
  
  1.6       +10 -10    cocoon-2.2/src/java/org/apache/cocoon/transformation/AbstractSAXTransformer.java
  
  Index: AbstractSAXTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/transformation/AbstractSAXTransformer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractSAXTransformer.java	9 Aug 2003 19:48:54 -0000	1.5
  +++ AbstractSAXTransformer.java	21 Oct 2003 12:45:12 -0000	1.6
  @@ -51,13 +51,13 @@
   package org.apache.cocoon.transformation;
   
   import org.apache.avalon.excalibur.pool.Recyclable;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
   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.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.Serviceable;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.environment.Context;
   import org.apache.cocoon.environment.ObjectModelHelper;
  @@ -125,7 +125,7 @@
   */
   public abstract class AbstractSAXTransformer
   extends AbstractTransformer
  -implements Composable, Configurable, Recyclable {
  +implements Serviceable, Configurable, Recyclable {
   
       /** Controlls SAX event handling.
        *  If set to true all whitespace events are ignored.
  @@ -183,8 +183,8 @@
       protected Parameters         parameters;
       /** The source attribute specified in the sitemap */
       protected String             source;
  -    /** The Avalon ComponentManager for getting Components */
  -    protected ComponentManager   manager;
  +    /** The Avalon ServiceManager for getting Components */
  +    protected ServiceManager   manager;
       /** The SourceResolver for this request */
       protected SourceResolver     resolver;
   
  @@ -276,10 +276,10 @@
       }
   
       /**
  -     * Avalon Composable Interface
  -     * @param manager The Avalon Component Manager
  +     * Avalon Serviceable Interface
  +     * @param manager The Avalon Service Manager
        */
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    public void service(ServiceManager manager) throws ServiceException {
           this.manager = manager;
       }