cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/stores AbstractInstance.java
Date Thu, 20 Nov 2003 16:39:32 GMT
joerg       2003/11/20 08:39:32

  Modified:    src/blocks/precept/java/org/apache/cocoon/precept/preceptors
                        AbstractPreceptor.java
               src/blocks/precept/java/org/apache/cocoon/precept/preceptors/easyrelax
                        PreceptorBuilderImpl.java
               src/blocks/precept/java/org/apache/cocoon/precept
                        InstanceFactory.java Instance.java
               src/blocks/precept/java/org/apache/cocoon/precept/stores/dom/simple
                        ElementNode.java
               src/blocks/precept/java/org/apache/cocoon/precept/stores/bean
                        InstanceImpl.java
               src/blocks/precept/java/org/apache/cocoon/precept/stores
                        AbstractInstance.java
  Log:
  Composable => Serviceable
  
  Revision  Changes    Path
  1.3       +9 -7      cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/preceptors/AbstractPreceptor.java
  
  Index: AbstractPreceptor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/preceptors/AbstractPreceptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractPreceptor.java	16 Mar 2003 17:49:05 -0000	1.2
  +++ AbstractPreceptor.java	20 Nov 2003 16:39:31 -0000	1.3
  @@ -50,10 +50,10 @@
   */
   package org.apache.cocoon.precept.preceptors;
   
  -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.logger.AbstractLogEnabled;
  +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.precept.Preceptor;
   
  @@ -62,10 +62,12 @@
    * @since Mar 18, 2002
    * @version CVS $Id$
    */
  -public abstract class AbstractPreceptor extends AbstractLogEnabled implements Preceptor,
Composable {
  -    protected ComponentManager manager;
  +public abstract class AbstractPreceptor extends AbstractLogEnabled
  +        implements Preceptor, Serviceable {
   
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    protected ServiceManager manager;
  +
  +    public void service(ServiceManager manager) throws ServiceException {
           this.manager = manager;
       }
   }
  
  
  
  1.3       +35 -17    cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/preceptors/easyrelax/PreceptorBuilderImpl.java
  
  Index: PreceptorBuilderImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/preceptors/easyrelax/PreceptorBuilderImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PreceptorBuilderImpl.java	16 Mar 2003 17:49:05 -0000	1.2
  +++ PreceptorBuilderImpl.java	20 Nov 2003 16:39:31 -0000	1.3
  @@ -50,43 +50,61 @@
   */
   package org.apache.cocoon.precept.preceptors.easyrelax;
   
  +import java.io.BufferedInputStream;
  +import java.io.InputStream;
  +import java.io.InputStreamReader;
  +import java.io.Reader;
  +import java.io.StringReader;
  +import java.net.URL;
  +import java.util.ArrayList;
  +import java.util.HashMap;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Map;
  +import java.util.Stack;
  +
  +import javax.xml.parsers.SAXParserFactory;
  +
   import org.apache.avalon.excalibur.pool.Poolable;
   import org.apache.avalon.framework.activity.Disposable;
  -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.SAXConfigurationHandler;
   import org.apache.avalon.framework.configuration.Configurable;
  +import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
   import org.apache.avalon.framework.logger.LogEnabled;
  +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.components.sax.XMLByteStreamInterpreter;
  -import org.apache.cocoon.xml.EmbeddedXMLPipe;
  -import org.apache.cocoon.xml.AbstractXMLConsumer;
  -import org.xml.sax.*;
  -import org.xml.sax.helpers.AttributesImpl;
  -import org.apache.cocoon.precept.Preceptor;
   import org.apache.cocoon.precept.Constraint;
  +import org.apache.cocoon.precept.Preceptor;
   import org.apache.cocoon.precept.preceptors.PreceptorBuilder;
  +import org.apache.cocoon.xml.AbstractXMLConsumer;
  +import org.apache.cocoon.xml.EmbeddedXMLPipe;
  +
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceResolver;
   
  -import javax.xml.parsers.SAXParserFactory;
  -import java.io.*;
  -import java.net.URL;
  -import java.util.*;
  +import org.xml.sax.Attributes;
  +import org.xml.sax.ContentHandler;
  +import org.xml.sax.InputSource;
  +import org.xml.sax.SAXException;
  +import org.xml.sax.XMLReader;
  +import org.xml.sax.helpers.AttributesImpl;
   
   /**
    * @author Torsten Curdt <tcurdt@dff.st>
    * @since Feb 23, 2002
    * @version CVS $Id$
    */
  -public class PreceptorBuilderImpl extends AbstractXMLConsumer implements PreceptorBuilder,
Composable, Disposable, Poolable {
  +public class PreceptorBuilderImpl extends AbstractXMLConsumer
  +        implements PreceptorBuilder, Serviceable, Disposable, Poolable {
       //public final static String ROLE = "org.apache.cocoon.precept.PreceptorBuilderImpl";
   
       public final static Attributes NOATTR = new AttributesImpl();
   
       public final static String NS = "http://www.dff.st/ns/desire/easyrelax/grammar/1.0";
   
  -    private ComponentManager manager;
  +    private ServiceManager manager;
   
       private SAXConfigurationHandler configurationHandler;
       private PreceptorImpl preceptor;
  @@ -410,7 +428,7 @@
           int len = 0;
       }
   
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    public void service(ServiceManager manager) throws ServiceException {
           this.manager = manager;
           //this.constraintFactory = (ConstraintFactory) manager.lookup(ConstraintFactory.ROLE);
           //this.preceptorRepository = (PreceptorRepository) manager.lookup(PreceptorRepository.ROLE);
  
  
  
  1.3       +15 -14    cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/InstanceFactory.java
  
  Index: InstanceFactory.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/InstanceFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InstanceFactory.java	16 Mar 2003 17:49:04 -0000	1.2
  +++ InstanceFactory.java	20 Nov 2003 16:39:31 -0000	1.3
  @@ -54,14 +54,14 @@
   import java.util.HashMap;
   
   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.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.logger.AbstractLogEnabled;
  +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.avalon.framework.thread.ThreadSafe;
   
   import org.apache.cocoon.precept.preceptors.PreceptorBuilder;
  @@ -71,11 +71,12 @@
    * @since Mar 18, 2002
    * @version CVS $Id$
    */
  -public class InstanceFactory extends AbstractLogEnabled implements Component, Configurable,
Composable, ThreadSafe {
  +public class InstanceFactory extends AbstractLogEnabled
  +        implements Component, Configurable, Serviceable, ThreadSafe {
   
       public final static String ROLE = "org.apache.cocoon.precept.InstanceFactory";
   
  -    private ComponentManager manager = null;
  +    private ServiceManager manager = null;
       private HashMap instanceConfigurationMap;
   
       public void configure(Configuration conf) throws ConfigurationException {
  @@ -99,25 +100,25 @@
           }
       }
   
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    public void service(ServiceManager manager) throws ServiceException {
           this.manager = manager;
       }
   
       public Instance createInstance(String name) {
           getLogger().debug("creating instance [" + String.valueOf(name) + "]");
           Configuration instanceConf = (Configuration) instanceConfigurationMap.get(name);
  -        ComponentSelector instanceSelector = null;
  +        ServiceSelector instanceSelector = null;
           Instance instance = null;
           try {
  -            instanceSelector = (ComponentSelector) manager.lookup(Instance.ROLE + "Selector");
  +            instanceSelector = (ServiceSelector) manager.lookup(Instance.ROLE + "Selector");
               instance = (Instance) instanceSelector.select(instanceConf.getAttribute("impl"));
   
               Configuration builderConf = instanceConf.getChild("preceptor");
               if (builderConf != null) {
  -                ComponentSelector preceptorBuilderSelector = null;
  +                ServiceSelector preceptorBuilderSelector = null;
                   PreceptorBuilder preceptorBuilder = null;
                   try {
  -                    preceptorBuilderSelector = (ComponentSelector) manager.lookup(PreceptorBuilder.ROLE
+ "Selector");
  +                    preceptorBuilderSelector = (ServiceSelector) manager.lookup(PreceptorBuilder.ROLE
+ "Selector");
                       preceptorBuilder = (PreceptorBuilder) preceptorBuilderSelector.select(builderConf.getAttribute("impl"));
   
                       String uri = builderConf.getAttribute("uri");
  @@ -129,7 +130,7 @@
   
                       instance.setPreceptor(newPreceptor);
                   }
  -                catch (ComponentException e) {
  +                catch (ServiceException e) {
                       if (preceptorBuilderSelector != null) {
                           getLogger().error("could not get preceptor builder", e);
                       }
  @@ -150,7 +151,7 @@
           catch (ConfigurationException e) {
               getLogger().error("", e);
           }
  -        catch (ComponentException e) {
  +        catch (ServiceException e) {
               getLogger().error("could not get instance selector", e);
           }
           finally {
  
  
  
  1.3       +4 -4      cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/Instance.java
  
  Index: Instance.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/Instance.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Instance.java	16 Mar 2003 17:49:04 -0000	1.2
  +++ Instance.java	20 Nov 2003 16:39:31 -0000	1.3
  @@ -50,12 +50,12 @@
   */
   package org.apache.cocoon.precept;
   
  +import java.util.Collection;
  +
   import org.apache.avalon.framework.component.Component;
  +
   import org.xml.sax.ContentHandler;
   import org.xml.sax.SAXException;
  -
  -
  -import java.util.Collection;
   
   /**
    * @author Torsten Curdt <tcurdt@dff.st>
  
  
  
  1.3       +8 -9      cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/stores/dom/simple/ElementNode.java
  
  Index: ElementNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/stores/dom/simple/ElementNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ElementNode.java	16 Mar 2003 17:49:05 -0000	1.2
  +++ ElementNode.java	20 Nov 2003 16:39:31 -0000	1.3
  @@ -50,18 +50,17 @@
   */
   package org.apache.cocoon.precept.stores.dom.simple;
   
  -import org.xml.sax.Attributes;
  +import java.util.ArrayList;
  +import java.util.Collection;
  +import java.util.HashMap;
  +import java.util.Iterator;
  +import java.util.List;
   
  +import org.apache.cocoon.precept.Constraint;
  +import org.xml.sax.Attributes;
   import org.xml.sax.ContentHandler;
  -
   import org.xml.sax.SAXException;
  -
   import org.xml.sax.helpers.AttributesImpl;
  -
  -import org.apache.cocoon.precept.Constraint;
  -
  -
  -import java.util.*;
   
   /**
    * @author Torsten Curdt <tcurdt@dff.st>
  
  
  
  1.3       +9 -18     cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/stores/bean/InstanceImpl.java
  
  Index: InstanceImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/stores/bean/InstanceImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InstanceImpl.java	16 Mar 2003 17:49:05 -0000	1.2
  +++ InstanceImpl.java	20 Nov 2003 16:39:32 -0000	1.3
  @@ -50,41 +50,32 @@
   */
   package org.apache.cocoon.precept.stores.bean;
   
  -import org.apache.avalon.framework.component.ComponentException;
  +import java.util.Collection;
   
   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.service.ServiceException;
   
   import org.apache.cocoon.components.classloader.ClassLoaderManager;
  -
  +import org.apache.cocoon.precept.Context;
  +import org.apache.cocoon.precept.InvalidXPathSyntaxException;
  +import org.apache.cocoon.precept.Preceptor;
  +import org.apache.cocoon.precept.PreceptorViolationException;
  +import org.apache.cocoon.precept.stores.AbstractInstance;
   import org.apache.cocoon.xml.DocumentHandlerAdapter;
   
   import org.apache.commons.jxpath.JXPathContext;
   
   import org.exolab.castor.mapping.Mapping;
  -
   import org.exolab.castor.mapping.MappingException;
  -
   import org.exolab.castor.xml.MarshalException;
  -
   import org.exolab.castor.xml.Marshaller;
  -
   import org.exolab.castor.xml.ValidationException;
   
   import org.xml.sax.ContentHandler;
  -
   import org.xml.sax.SAXException;
   
  -import org.apache.cocoon.precept.*;
  -
  -import org.apache.cocoon.precept.stores.AbstractInstance;
  -
  -
  -import java.util.Collection;
  -
   /**
    * @author Torsten Curdt <tcurdt@dff.st>
    * @since Mar 15, 2002
  @@ -122,7 +113,7 @@
                   clazzLoader = (ClassLoaderManager) manager.lookup(ClassLoaderManager.ROLE);
                   Class clazz = clazzLoader.loadClass(clazzName);
                   setBean(clazz.newInstance());
  -            } catch (ComponentException e) {
  +            } catch (ServiceException e) {
                   throw new ConfigurationException("", e);
               } catch (ClassNotFoundException e) {
                   throw new ConfigurationException("", e);
  
  
  
  1.3       +10 -17    cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/stores/AbstractInstance.java
  
  Index: AbstractInstance.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/precept/java/org/apache/cocoon/precept/stores/AbstractInstance.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractInstance.java	16 Mar 2003 17:49:05 -0000	1.2
  +++ AbstractInstance.java	20 Nov 2003 16:39:32 -0000	1.3
  @@ -51,34 +51,27 @@
   package org.apache.cocoon.precept.stores;
   
   
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -
  -import org.apache.avalon.framework.component.Composable;
  -
  -import org.apache.avalon.framework.component.ComponentManager;
  -
  -import org.apache.avalon.framework.component.ComponentException;
  +import javax.servlet.http.HttpSessionBindingEvent;
  +import javax.servlet.http.HttpSessionBindingListener;
   
   import org.apache.avalon.framework.activity.Disposable;
  -
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +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.precept.Instance;
   
  -
  -import javax.servlet.http.HttpSessionBindingListener;
  -
  -import javax.servlet.http.HttpSessionBindingEvent;
  -
   /**
    * @author Torsten Curdt <tcurdt@dff.st>
    * @since Mar 18, 2002
    * @version CVS $Id$
    */
   public abstract class AbstractInstance extends AbstractLogEnabled
  -        implements Instance, Composable, Disposable, HttpSessionBindingListener {
  +        implements Instance, Serviceable, Disposable, HttpSessionBindingListener {
   
  -    protected ComponentManager manager;
  +    protected ServiceManager manager;
   
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    public void service(ServiceManager manager) throws ServiceException {
           this.manager = manager;
       }
   
  
  
  

Mime
View raw message