cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon PoolClient.java CocoonComponentSelector.java ComponentFactory.java DefaultComponentManager.java
Date Fri, 16 Feb 2001 20:28:59 GMT
bloritsch    01/02/16 12:28:59

  Modified:    src/org/apache/cocoon Tag: xml-cocoon2
                        CocoonComponentSelector.java ComponentFactory.java
                        DefaultComponentManager.java
  Added:       src/org/apache/cocoon Tag: xml-cocoon2 PoolClient.java
  Log:
  Compiled Sheet optimization stuff
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.19  +3 -2      xml-cocoon/src/org/apache/cocoon/Attic/CocoonComponentSelector.java
  
  Index: CocoonComponentSelector.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Attic/CocoonComponentSelector.java,v
  retrieving revision 1.1.2.18
  retrieving revision 1.1.2.19
  diff -u -r1.1.2.18 -r1.1.2.19
  --- CocoonComponentSelector.java	2001/02/16 18:11:34	1.1.2.18
  +++ CocoonComponentSelector.java	2001/02/16 20:28:53	1.1.2.19
  @@ -42,7 +42,7 @@
   /** Default component manager for Cocoon's non sitemap components.
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
  - * @version CVS $Revision: 1.1.2.18 $ $Date: 2001/02/16 18:11:34 $
  + * @version CVS $Revision: 1.1.2.19 $ $Date: 2001/02/16 20:28:53 $
    */
   public class CocoonComponentSelector implements Contextualizable, ComponentSelector, Composer,
Configurable, ThreadSafe, Loggable {
       protected Logger log;
  @@ -224,10 +224,11 @@
   
           if ( pool == null ) {
               try {
  -                ComponentFactory cf = new ComponentFactory(componentClass, (Configuration)configurations.get(hint),
this.manager);
  +                ComponentFactory cf = new ComponentFactory(componentClass, (Configuration)configurations.get(hint),
this.manager, this.context);
                   cf.setLogger(this.log);
   
                   pool = new ComponentPool(cf, new ComponentPoolController());
  +                cf.setPool(pool);
                   pool.setLogger(this.log);
                   pool.init();
               } catch (Exception e) {
  
  
  
  1.1.2.8   +20 -7     xml-cocoon/src/org/apache/cocoon/Attic/ComponentFactory.java
  
  Index: ComponentFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Attic/ComponentFactory.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- ComponentFactory.java	2001/02/16 18:11:37	1.1.2.7
  +++ ComponentFactory.java	2001/02/16 20:28:54	1.1.2.8
  @@ -17,17 +17,17 @@
   import org.apache.avalon.Configurable;
   import org.apache.avalon.Composer;
   import org.apache.avalon.ThreadSafe;
  +import org.apache.avalon.Contextualizable;
  +import org.apache.avalon.Context;
   
   import org.apache.log.Logger;
   import org.apache.avalon.Loggable;
   
  -import org.apache.cocoon.components.language.generator.AbstractCompiledComponent;
  -
   /** Factory for Cocoon components.
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/02/16 18:11:37 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/02/16 20:28:54 $
    */
  -public class ComponentFactory implements ObjectFactory, ThreadSafe, Loggable {
  +public class ComponentFactory implements ObjectFactory, PoolClient, ThreadSafe, Loggable
{
       private Logger log;
   
       /** The class which this <code>ComponentFactory</code>
  @@ -43,6 +43,12 @@
        */
       private ComponentManager manager;
   
  +    /** The Context for the component
  +     */
  +    private Context context;
  +
  +    /** The Pool for the component
  +     */
       private Pool pool;
   
       public void setPool(Pool pool) {
  @@ -56,10 +62,11 @@
        * @param config the <code>Configuration</code> object to pass to new instances.
        * @param manager the component manager to pass to <code>Composer</code>s.
        */
  -    public ComponentFactory(Class componentClass, Configuration config, ComponentManager
manager) {
  +    public ComponentFactory(Class componentClass, Configuration config, ComponentManager
manager, Context context) {
           this.componentClass = componentClass;
           this.conf = config;
           this.manager = manager;
  +        this.context = context;
       }
   
       public void setLogger(Logger logger) {
  @@ -75,6 +82,10 @@
               + componentClass.getName() + "."
           );
   
  +        if ( comp instanceof Contextualizable ) {
  +            ((Contextualizable)comp).contextualize(this.context);
  +        }
  +
           if ( comp instanceof Loggable) {
               ((Loggable)comp).setLogger(this.log);
           }
  @@ -87,12 +98,14 @@
               ((Composer)comp).compose(this.manager);
           }
   
  -        if ( comp instanceof AbstractCompiledComponent) {
  -            ((AbstractCompiledComponent) comp).setPool(this.pool);
  +        if ( comp instanceof PoolClient) {
  +            ((PoolClient) comp).setPool(this.pool);
           }
   
           return comp;
       }
  +
  +    public void returnToPool() {}
   
       public final Class getCreatedClass() {
           return componentClass;
  
  
  
  1.1.2.18  +3 -2      xml-cocoon/src/org/apache/cocoon/Attic/DefaultComponentManager.java
  
  Index: DefaultComponentManager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Attic/DefaultComponentManager.java,v
  retrieving revision 1.1.2.17
  retrieving revision 1.1.2.18
  diff -u -r1.1.2.17 -r1.1.2.18
  --- DefaultComponentManager.java	2001/02/16 18:11:38	1.1.2.17
  +++ DefaultComponentManager.java	2001/02/16 20:28:55	1.1.2.18
  @@ -40,7 +40,7 @@
   
   /** Default component manager for Cocoon's non sitemap components.
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
  - * @version CVS $Revision: 1.1.2.17 $ $Date: 2001/02/16 18:11:38 $
  + * @version CVS $Revision: 1.1.2.18 $ $Date: 2001/02/16 20:28:55 $
    */
   public class DefaultComponentManager implements ComponentManager, Configurable, Loggable
{
   
  @@ -262,10 +262,11 @@
           if ( pool == null ) {
               try {
                   log.debug("Creating new component pool for " + componentClass.getName()
+ ".");
  -                ComponentFactory cf = new ComponentFactory(componentClass, (Configuration)configurations.get(role),
this);
  +                ComponentFactory cf = new ComponentFactory(componentClass, (Configuration)configurations.get(role),
this, this.context);
                   cf.setLogger(this.log);
   
                   pool = new ComponentPool(cf, new ComponentPoolController());
  +                cf.setPool(pool);
                   pool.setLogger(this.log);
                   pool.init();
               } catch (Exception e) {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +23 -0     xml-cocoon/src/org/apache/cocoon/Attic/PoolClient.java
  
  
  
  

Mime
View raw message