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 CocoonComponentManager.java
Date Wed, 07 Jan 2004 15:48:33 GMT
cziegeler    2004/01/07 07:48:32

  Modified:    src/java/org/apache/cocoon/components/flow/javascript
                        JSCocoon.java
               src/java/org/apache/cocoon/components/source SourceUtil.java
               src/java/org/apache/cocoon/components
                        CocoonComponentManager.java
  Log:
  Remove unused methods
  
  Revision  Changes    Path
  1.15      +7 -7      cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java
  
  Index: JSCocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JSCocoon.java	28 Dec 2003 21:09:59 -0000	1.14
  +++ JSCocoon.java	7 Jan 2004 15:48:32 -0000	1.15
  @@ -59,6 +59,7 @@
   import org.mozilla.javascript.JavaScriptException;
   
   import org.apache.cocoon.sitemap.SitemapRedirector;
  +import org.apache.cocoon.environment.EnvironmentHelper;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.environment.Session;
   import org.apache.cocoon.environment.Response;
  @@ -69,7 +70,6 @@
   import org.apache.cocoon.environment.Context;
   import org.apache.cocoon.components.modules.output.OutputModule;
   import org.apache.cocoon.components.modules.input.InputModule;
  -import org.apache.cocoon.components.CocoonComponentManager;
   import org.apache.cocoon.components.cprocessor.sitemap.PipelinesNode;
   import org.apache.cocoon.components.flow.ContinuationsManager;
   import org.apache.cocoon.components.flow.WebContinuation;
  @@ -348,7 +348,7 @@
           Redirector redirector = new SitemapRedirector(this.environment);
           SourceResolver resolver = (SourceResolver)this.environment.getObjectModel()
               .get(OBJECT_SOURCE_RESOLVER);
  -        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceManager sitemapManager = EnvironmentHelper.getSitemapServiceManager();
           ServiceSelector actionSelector
               = (ServiceSelector)sitemapManager.lookup(Action.ROLE + "Selector");
           Action action = (Action)actionSelector.select(type);
  @@ -390,7 +390,7 @@
       {
           // since no new components can be declared on sitemap we could
           // very well use the 'other' one here. Anyway, since it's there...
  -        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceManager sitemapManager = EnvironmentHelper.getSitemapServiceManager();
           ServiceSelector inputSelector = (ServiceSelector)sitemapManager
               .lookup(InputModule.ROLE + "Selector");
           InputModule input = (InputModule) inputSelector.select(type);
  @@ -410,7 +410,7 @@
       {
           // since no new components can be declared on sitemap we could
           // very well use the 'other' one here. Anyway, since it's there...
  -        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceManager sitemapManager = EnvironmentHelper.getSitemapServiceManager();
           ServiceSelector outputSelector = (ServiceSelector)sitemapManager
               .lookup(OutputModule.ROLE + "Selector");
           OutputModule output = (OutputModule) outputSelector.select(type);
  @@ -428,7 +428,7 @@
       {
           // since no new components can be declared on sitemap we could
           // very well use the 'other' one here. Anyway, since it's there...
  -        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceManager sitemapManager = EnvironmentHelper.getSitemapServiceManager();
           ServiceSelector outputSelector = (ServiceSelector)sitemapManager
               .lookup(OutputModule.ROLE + "Selector");
           OutputModule output = (OutputModule) outputSelector.select(type);
  @@ -444,7 +444,7 @@
       {
           // since no new components can be declared on sitemap we could
           // very well use the 'other' one here. Anyway, since it's there...
  -        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceManager sitemapManager = EnvironmentHelper.getSitemapServiceManager();
           ServiceSelector outputSelector = (ServiceSelector)sitemapManager
               .lookup(OutputModule.ROLE + "Selector");
           OutputModule output = (OutputModule) outputSelector.select(type);
  
  
  
  1.10      +6 -6      cocoon-2.2/src/java/org/apache/cocoon/components/source/SourceUtil.java
  
  Index: SourceUtil.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/source/SourceUtil.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SourceUtil.java	19 Oct 2003 17:46:19 -0000	1.9
  +++ SourceUtil.java	7 Jan 2004 15:48:32 -0000	1.10
  @@ -62,7 +62,7 @@
   import org.apache.avalon.framework.service.ServiceSelector;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.ResourceNotFoundException;
  -import org.apache.cocoon.components.CocoonComponentManager;
  +import org.apache.cocoon.environment.EnvironmentHelper;
   import org.apache.cocoon.serialization.Serializer;
   import org.apache.cocoon.xml.IncludeXMLConsumer;
   import org.apache.cocoon.xml.XMLUtils;
  @@ -122,7 +122,7 @@
       static public void toSAX( Source source,
                                 ContentHandler handler)
       throws SAXException, IOException, ProcessingException {
  -        toSAX(CocoonComponentManager.getSitemapComponentManager(), 
  +        toSAX(EnvironmentHelper.getSitemapServiceManager(), 
                 source, null, handler);
       }
   
  @@ -138,7 +138,7 @@
                                   String mimeTypeHint,
                                 ContentHandler handler)
       throws SAXException, IOException, ProcessingException {
  -        toSAX(CocoonComponentManager.getSitemapComponentManager(), 
  +        toSAX(EnvironmentHelper.getSitemapServiceManager(), 
                 source, mimeTypeHint, handler);
       }
   
  @@ -450,7 +450,7 @@
                   frag.normalize();
   
                   if ( null != serializerName) {
  -					ServiceManager manager = CocoonComponentManager.getSitemapComponentManager();
  +					ServiceManager manager = EnvironmentHelper.getSitemapServiceManager();
   
   	                ServiceSelector selector = null;
   	                Serializer serializer = null;
  @@ -491,7 +491,7 @@
               } else {
               	String content;
   				if ( null != serializerName) {
  -					ServiceManager  manager = CocoonComponentManager.getSitemapComponentManager();
  +					ServiceManager  manager = EnvironmentHelper.getSitemapServiceManager();
                       
                       ServiceSelector selector = null;
                       Serializer serializer = null;
  
  
  
  1.30      +1 -98     cocoon-2.2/src/java/org/apache/cocoon/components/CocoonComponentManager.java
  
  Index: CocoonComponentManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/CocoonComponentManager.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- CocoonComponentManager.java	5 Nov 2003 21:29:08 -0000	1.29
  +++ CocoonComponentManager.java	7 Jan 2004 15:48:32 -0000	1.30
  @@ -50,15 +50,9 @@
   */
   package org.apache.cocoon.components;
   
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.ServiceSelector;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.environment.EnvironmentHelper;
  -
  -import java.util.ArrayList;
  -import java.util.Iterator;
   
   /**
    * Cocoon Component Manager.
  @@ -74,99 +68,8 @@
    * @version CVS $Id$
    */
   public final class CocoonComponentManager
  -implements ServiceManager
   {
   
  -    /** The parent component manager for implementing parent aware components */
  -    private ServiceManager parentManager;
  -
  -    /** Temporary list of parent-aware components.  Will be null for most of
  -     * our lifecycle. */
  -    private ArrayList parentAwareComponents = new ArrayList();
  -
  -    /** Create the ComponentManager */
  -    public CocoonComponentManager() {
  -    }
  -
  -    /** Create the ComponentManager with a parent ComponentManager */
  -    public CocoonComponentManager(final ServiceManager manager) {
  -        this.parentManager = manager;
  -    }
  -
  -    public boolean hasService(String role)
  -    {
  -        return parentManager.hasService(role);
  -    }
  -
  -    /**
  -     * Return an instance of a component based on a Role.  The Role is usually the Interface's
  -     * Fully Qualified Name(FQN)--unless there are multiple Components for the same Role.
 In that
  -     * case, the Role's FQN is appended with "Selector", and we return a ComponentSelector.
  -     */
  -    public Object lookup( final String role )
  -    throws ServiceException {
  -        return parentManager.lookup(role);
  -    }
  -
  -    /**
  -     * Release a Component.  This implementation makes sure it has a handle on the propper
  -     * ComponentHandler, and let's the ComponentHandler take care of the actual work.
  -     */
  -    public void release( final Object component ) {
  -        parentManager.release( component);
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see org.apache.avalon.excalibur.component.ExcaliburComponentManager#addComponent(java.lang.String,
java.lang.Class, org.apache.avalon.framework.configuration.Configuration)
  -     */
  -    public void addComponent(String role, Class clazz, Configuration conf)
  -        throws ServiceException {
  -//        super.addComponent(role, clazz, conf);
  -        // Note that at this point, we're not initialized and cannot do
  -        // lookups, so defer parental introductions to initialize().
  -        if ( ParentAware.class.isAssignableFrom( clazz ) ) {
  -            parentAwareComponents.add(role);
  -        }
  -    }
  -
  -    public void initialize()
  -        throws Exception
  -    {
  -//        super.initialize();
  -        if (parentAwareComponents == null) {
  -            throw new ServiceException(null, "CocoonComponentManager already initialized");
  -        }
  -        // Set parents for parentAware components
  -        Iterator iter = parentAwareComponents.iterator();
  -        while (iter.hasNext()) {
  -            String role = (String)iter.next();
  -//            getLogger().debug(".. "+role);
  -            if ( parentManager != null && parentManager.hasService( role ) ) {
  -                // lookup new component
  -                Object component = null;
  -                try {
  -                    component = this.lookup( role );
  -                    ((ParentAware)component).setParentLocator( new ComponentLocatorImpl(this.parentManager,
role ));
  -                } catch (ServiceException ignore) {
  -                    // we don't set the parent then
  -                } finally {
  -                    this.release( component );
  -                }
  -            }
  -        }
  -        parentAwareComponents = null;  // null to save memory, and catch logic bugs.
  -    }
  -    
  -    /**
  -     * Get the current sitemap component manager.
  -     * This method return the current sitemap component manager. This
  -     * is the manager that holds all the components of the currently
  -     * processed (sub)sitemap.
  -     */
  -    static public ServiceManager getSitemapComponentManager() {
  -        return EnvironmentHelper.getSitemapServiceManager();
  -    }
  -    
       /**
        * Add an automatically released component
        */
  
  
  

Mime
View raw message