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.1 status.xml
Date Wed, 09 Jun 2004 11:59:23 GMT
cziegeler    2004/06/09 04:59:23

  Modified:    src/java/org/apache/cocoon/components/treeprocessor
                        ContainerNode.java
                        AbstractProcessingNodeBuilder.java
                        CategoryNode.java
                        PipelineEventComponentProcessingNode.java
                        NamedContainerNode.java
                        SimpleParentProcessingNode.java
                        CategoryNodeBuilder.java
                        SimpleSelectorProcessingNode.java NullNode.java
                        ContainerNodeBuilder.java
                        AbstractParentProcessingNode.java
                        DefaultTreeBuilder.java AbstractProcessingNode.java
                        ConcreteTreeProcessor.java
               src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        ActSetNode.java ActTypeNode.java AggregateNode.java
                        CallNode.java CallFunctionNode.java
                        PipelinesNode.java
               .        status.xml
  Added:       src/java/org/apache/cocoon/sitemap/impl DefaultExecutor.java
               src/java/org/apache/cocoon/sitemap ExecutionContext.java
                        SitemapExecutor.java
  Log:
       Add profiling/debugging API for the sitemap.
  (Not finished yet, only actions are implemented yet)
  
  Revision  Changes    Path
  1.3       +8 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/ContainerNode.java
  
  Index: ContainerNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/ContainerNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContainerNode.java	5 Mar 2004 13:02:51 -0000	1.2
  +++ ContainerNode.java	9 Jun 2004 11:59:23 -0000	1.3
  @@ -26,6 +26,13 @@
   
   public class ContainerNode extends SimpleParentProcessingNode {
   
  +    public ContainerNode(String type) {
  +        super(type);
  +    }
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.components.treeprocessor.ProcessingNode#invoke(org.apache.cocoon.environment.Environment,
org.apache.cocoon.components.treeprocessor.InvokeContext)
  +     */
       public final boolean invoke(Environment env, InvokeContext context) throws Exception
{
   
           return invokeNodes(this.children, env, context);
  
  
  
  1.5       +10 -1     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java
  
  Index: AbstractProcessingNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractProcessingNodeBuilder.java	8 Mar 2004 12:07:39 -0000	1.4
  +++ AbstractProcessingNodeBuilder.java	9 Jun 2004 11:59:23 -0000	1.5
  @@ -41,14 +41,23 @@
       
       protected ComponentManager manager;
   
  +    /* (non-Javadoc)
  +     * @see org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
  +     */
       public void compose(ComponentManager manager) throws ComponentException {
           this.manager = manager;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.avalon.framework.component.Recomposable#recompose(org.apache.avalon.framework.component.ComponentManager)
  +     */
       public void recompose(ComponentManager manager) throws ComponentException {
           this.manager = manager;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.components.treeprocessor.ProcessingNodeBuilder#setBuilder(org.apache.cocoon.components.treeprocessor.TreeBuilder)
  +     */
       public void setBuilder(TreeBuilder treeBuilder) {
           this.treeBuilder = treeBuilder;
       }
  
  
  
  1.4       +5 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/CategoryNode.java
  
  Index: CategoryNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/CategoryNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CategoryNode.java	5 Mar 2004 13:02:51 -0000	1.3
  +++ CategoryNode.java	9 Jun 2004 11:59:23 -0000	1.4
  @@ -30,6 +30,10 @@
   
   public final class CategoryNode extends AbstractParentProcessingNode {
   
  +    public CategoryNode(String type) {
  +        super(type);
  +    }
  +    
       /** The name of this category */
       private String categoryName;
   
  
  
  
  1.4       +5 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/PipelineEventComponentProcessingNode.java
  
  Index: PipelineEventComponentProcessingNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/PipelineEventComponentProcessingNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PipelineEventComponentProcessingNode.java	5 Mar 2004 13:02:51 -0000	1.3
  +++ PipelineEventComponentProcessingNode.java	9 Jun 2004 11:59:23 -0000	1.4
  @@ -27,6 +27,10 @@
       protected Map views;
       protected Map pipelineHints;
   
  +    public PipelineEventComponentProcessingNode() {
  +        super(null);
  +    }
  +
       public void setViews(Map views) {
           this.views = views;
       }
  
  
  
  1.3       +2 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/NamedContainerNode.java
  
  Index: NamedContainerNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/NamedContainerNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NamedContainerNode.java	5 Mar 2004 13:02:51 -0000	1.2
  +++ NamedContainerNode.java	9 Jun 2004 11:59:23 -0000	1.3
  @@ -27,6 +27,7 @@
       private String name;
   
       public NamedContainerNode(String name) {
  +        super(name);
           this.name = name;
       }
   
  
  
  
  1.3       +5 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/SimpleParentProcessingNode.java
  
  Index: SimpleParentProcessingNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/SimpleParentProcessingNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SimpleParentProcessingNode.java	5 Mar 2004 13:02:51 -0000	1.2
  +++ SimpleParentProcessingNode.java	9 Jun 2004 11:59:23 -0000	1.3
  @@ -31,6 +31,10 @@
       /** The childrens of this matcher */
       protected ProcessingNode[] children;
   
  +    public SimpleParentProcessingNode(String type) {
  +        super(type);
  +    }
  +    
       public void setChildren(ProcessingNode[] children) {
           this.children = children;
       }
  
  
  
  1.4       +2 -2      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/CategoryNodeBuilder.java
  
  Index: CategoryNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/CategoryNodeBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CategoryNodeBuilder.java	5 Mar 2004 13:02:51 -0000	1.3
  +++ CategoryNodeBuilder.java	9 Jun 2004 11:59:23 -0000	1.4
  @@ -56,7 +56,7 @@
   
       public ProcessingNode buildNode(Configuration config) throws Exception {
   
  -        CategoryNode node = new CategoryNode();
  +        CategoryNode node = new CategoryNode(null);
           this.treeBuilder.setupNode(node, config);
   
           // Get all children and associate them to their name
  
  
  
  1.4       +2 -5      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/SimpleSelectorProcessingNode.java
  
  Index: SimpleSelectorProcessingNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/SimpleSelectorProcessingNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleSelectorProcessingNode.java	5 Mar 2004 13:02:51 -0000	1.3
  +++ SimpleSelectorProcessingNode.java	9 Jun 2004 11:59:23 -0000	1.4
  @@ -28,14 +28,11 @@
   
   public abstract class SimpleSelectorProcessingNode extends SimpleParentProcessingNode {
   
  -    /** The node component name (e.g. action name, selector name, etc) */
  -    protected String componentName;
  -
       /** Selector where to get components from */
       protected ComponentSelector selector;
   
       public SimpleSelectorProcessingNode(String componentName) {
  -        this.componentName = componentName;
  +        super(componentName);
       }
   
       public void setSelector(ComponentSelector selector) throws ComponentException {
  
  
  
  1.3       +5 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/NullNode.java
  
  Index: NullNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/NullNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NullNode.java	5 Mar 2004 13:02:51 -0000	1.2
  +++ NullNode.java	9 Jun 2004 11:59:23 -0000	1.3
  @@ -26,6 +26,10 @@
   
   public class NullNode extends AbstractProcessingNode {
   
  +    public NullNode() {
  +        super(null);
  +    }
  +    
       public final boolean invoke(Environment env, InvokeContext context) throws Exception
{
   
           getLogger().warn("Invoke on NullNode at " + getLocation());
  
  
  
  1.3       +2 -2      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/ContainerNodeBuilder.java
  
  Index: ContainerNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/ContainerNodeBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContainerNodeBuilder.java	5 Mar 2004 13:02:51 -0000	1.2
  +++ ContainerNodeBuilder.java	9 Jun 2004 11:59:23 -0000	1.3
  @@ -35,7 +35,7 @@
   
       public ProcessingNode buildNode(Configuration config) throws Exception {
   
  -        ContainerNode node = new ContainerNode();
  +        ContainerNode node = new ContainerNode(null);
           setupNode(node, config);
   
           return node;
  
  
  
  1.4       +8 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/AbstractParentProcessingNode.java
  
  Index: AbstractParentProcessingNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/AbstractParentProcessingNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractParentProcessingNode.java	5 Mar 2004 13:02:51 -0000	1.3
  +++ AbstractParentProcessingNode.java	9 Jun 2004 11:59:23 -0000	1.4
  @@ -27,6 +27,13 @@
   
   public abstract class AbstractParentProcessingNode extends AbstractProcessingNode {
   
  +    public AbstractParentProcessingNode(String type) {
  +        super(type);
  +    }
  +    
  +    public AbstractParentProcessingNode() {
  +    }
  +
       /**
        * Invoke all nodes of a node array in order, until one succeeds.
        *
  
  
  
  1.11      +2 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java
  
  Index: DefaultTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultTreeBuilder.java	9 Jun 2004 09:41:15 -0000	1.10
  +++ DefaultTreeBuilder.java	9 Jun 2004 11:59:23 -0000	1.11
  @@ -467,6 +467,7 @@
         throws Exception {
           if (node instanceof AbstractProcessingNode) {
               ((AbstractProcessingNode)node).setLocation(config.getLocation());
  +            ((AbstractProcessingNode)node).setSitemapExecutor(this.processor.getSitemapExecutor());
           }
   
           this.lifecycle.setupComponent(node, false);
  
  
  
  1.5       +34 -2     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNode.java
  
  Index: AbstractProcessingNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNode.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractProcessingNode.java	25 May 2004 14:27:32 -0000	1.4
  +++ AbstractProcessingNode.java	9 Jun 2004 11:59:23 -0000	1.5
  @@ -16,6 +16,8 @@
   package org.apache.cocoon.components.treeprocessor;
   
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.cocoon.sitemap.ExecutionContext;
  +import org.apache.cocoon.sitemap.SitemapExecutor;
   
   /**
    *
  @@ -23,10 +25,25 @@
    * @version CVS $Id$
    */
   
  -public abstract class AbstractProcessingNode extends AbstractLogEnabled implements ProcessingNode
{
  +public abstract class AbstractProcessingNode 
  +    extends AbstractLogEnabled 
  +    implements ProcessingNode, ExecutionContext {
   
       protected String location = "unknown location";
   
  +    /** The type of the component */
  +    protected String componentName;
  +    
  +    /** The sitemap executor */
  +    protected SitemapExecutor executor;
  +    
  +    public AbstractProcessingNode(String type) {
  +        this.componentName = type;
  +    }
  +    
  +    public AbstractProcessingNode() {
  +    }
  +
       /**
        * Get the location of this node.
        */
  @@ -39,5 +56,20 @@
        */
       public void setLocation(String location) {
           this.location = location;
  +    }
  +    
  +    /**
  +     * Set the sitemap executor
  +     */
  +    public void setSitemapExecutor(SitemapExecutor executor) {
  +        this.executor = executor;
  +    }
  +    
  +    
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.sitemap.ExecutionContext#getType()
  +     */
  +    public String getType() {
  +        return this.componentName;
       }
   }
  
  
  
  1.2       +56 -3     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
  
  Index: ConcreteTreeProcessor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConcreteTreeProcessor.java	5 Jun 2004 08:18:50 -0000	1.1
  +++ ConcreteTreeProcessor.java	9 Jun 2004 11:59:23 -0000	1.2
  @@ -22,7 +22,10 @@
   import java.util.List;
   import java.util.Map;
   
  +import org.apache.avalon.framework.CascadingRuntimeException;
   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.configuration.Configuration;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  @@ -39,6 +42,8 @@
   import org.apache.cocoon.environment.internal.EnvironmentHelper;
   import org.apache.cocoon.environment.wrapper.EnvironmentWrapper;
   import org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade;
  +import org.apache.cocoon.sitemap.SitemapExecutor;
  +import org.apache.cocoon.sitemap.impl.DefaultExecutor;
   
   
   /**
  @@ -70,9 +75,46 @@
       /** Number of simultaneous uses of this processor (either by concurrent request or
by internal requests) */
       private int requestCount;
       
  +    /** The sitemap executor */
  +    private SitemapExecutor sitemapExecutor;
  +    
  +    /** Release the executor */
  +    private boolean releaseSitemapExecutor;
  +    
   	/** Builds a concrete processig, given the wrapping processor */
   	public ConcreteTreeProcessor(TreeProcessor wrappingProcessor) {
   		this.wrappingProcessor = wrappingProcessor;
  +        // get the sitemap executor - we use the same executor for each sitemap
  +        this.releaseSitemapExecutor = false;
  +        if ( this.wrappingProcessor.parent == null ) {
  +            final ComponentManager manager = this.wrappingProcessor.manager;
  +            if ( manager.hasComponent(SitemapExecutor.ROLE) ) {
  +                try {
  +                    this.sitemapExecutor = (SitemapExecutor) manager.lookup(SitemapExecutor.ROLE);
  +                    this.releaseSitemapExecutor = true;
  +                } catch (ComponentException ce) {
  +                    // this should not happen as we called hasComponent first
  +                    // but we ignore it
  +                    this.getLogger().error("Unable to lookup sitemap executor.", ce);
  +                }
  +            }
  +            if ( this.sitemapExecutor == null ) {                
  +                try {
  +                    this.sitemapExecutor = (SitemapExecutor) this.getClass()
  +                                 .getClassLoader()
  +                                 .loadClass(DefaultExecutor.class.getName())
  +                                 .newInstance();
  +                } catch (InstantiationException e) {
  +                    throw new CascadingRuntimeException("Unable to create default sitemap
executor.", e);
  +                } catch (IllegalAccessException e) {
  +                    throw new CascadingRuntimeException("Unable to create default sitemap
executor.", e);
  +                } catch (ClassNotFoundException e) {
  +                    throw new CascadingRuntimeException("Unable to create default sitemap
executor.", e);
  +                }
  +            }
  +        } else {
  +            this.sitemapExecutor = this.wrappingProcessor.parent.concreteProcessor.sitemapExecutor;
  +        }
   	}
   	
   	/** Set the processor data, result of the treebuilder job */
  @@ -85,7 +127,7 @@
   		this.serviceManager = new ComponentManagerWrapper(manager);
   		this.rootNode = rootNode;
   		this.disposableNodes = disposableNodes;
  -	}
  +   	}
   	
   	/** Set the sitemap component configurations (called as part of the tree building process)
*/
       public void setComponentConfigurations(Configuration componentConfigurations) {
  @@ -261,7 +303,7 @@
       }
           
       
  -    private boolean handleCocoonRedirect(String uri, Environment environment, InvokeContext
context) throws Exception {
  +    protected boolean handleCocoonRedirect(String uri, Environment environment, InvokeContext
context) throws Exception {
           
           // Build an environment wrapper
           // If the current env is a facade, change the delegate and continue processing
the facade, since
  @@ -314,6 +356,10 @@
           
           // Ensure it won't be used anymore
           this.rootNode = null;
  +        if ( this.releaseSitemapExecutor ) {
  +            this.wrappingProcessor.manager.release( (Component)this.sitemapExecutor );
  +            this.sitemapExecutor = null;
  +        }
   	}
       
       private class TreeProcessorRedirector extends ForwardRedirector {
  @@ -382,4 +428,11 @@
   	public String getContext() {
   		return wrappingProcessor.getContext();
   	}
  +    
  +    /**
  +     * Return the sitemap executor
  +     */
  +    public SitemapExecutor getSitemapExecutor() {
  +        return this.sitemapExecutor;
  +    }
   }
  
  
  
  1.1                  cocoon-2.1/src/java/org/apache/cocoon/sitemap/impl/DefaultExecutor.java
  
  Index: DefaultExecutor.java
  ===================================================================
  /*
   * Copyright 1999-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.cocoon.sitemap.impl;
  
  import java.util.Map;
  
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.acting.Action;
  import org.apache.cocoon.environment.Redirector;
  import org.apache.cocoon.environment.SourceResolver;
  import org.apache.cocoon.sitemap.ExecutionContext;
  import org.apache.cocoon.sitemap.SitemapExecutor;
  
  /**
   * This is the default executor that does nothing but just executing the
   * statements.
   * TODO - This is not finished yet!
   * 
   * @since 2.2
   * @version CVS $Id: DefaultExecutor.java,v 1.1 2004/06/09 11:59:23 cziegeler Exp $
   */
  public class DefaultExecutor 
      implements SitemapExecutor {
      
      /* (non-Javadoc)
       * @see org.apache.cocoon.sitemap.SitemapExecutor#invokeAction(org.apache.cocoon.acting.Action,
org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver, java.util.Map,
java.lang.String, org.apache.avalon.framework.parameters.Parameters)
       */
      public Map invokeAction(final ExecutionContext context,
                              final Action           action, 
                              final Redirector       redirector, 
                              final SourceResolver   resolver, 
                              final Map              objectModel, 
                              final String           resolvedSource, 
                              final Parameters       resolvedParams )
      throws Exception {
          return action.act(redirector, resolver, objectModel, 
                  resolvedSource, resolvedParams);        
      }
      
  }
  
  
  
  1.1                  cocoon-2.1/src/java/org/apache/cocoon/sitemap/ExecutionContext.java
  
  Index: ExecutionContext.java
  ===================================================================
  /*
   * Copyright 1999-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.cocoon.sitemap;
  
  
  /**
   * This context contains information about the current statement that should
   * be executed like the location in the sitemap etc.
   *
   * TODO - This is not finished yet!
   * 
   * @since 2.2
   * @version CVS $Id: ExecutionContext.java,v 1.1 2004/06/09 11:59:23 cziegeler Exp $
   */
  public interface ExecutionContext {
      
      /**
       * Return the location of the statement in the sitemap.
       */
      String getLocation();
      
      /**
       * Return the component type
       */
      String getType();
  }
  
  
  
  1.1                  cocoon-2.1/src/java/org/apache/cocoon/sitemap/SitemapExecutor.java
  
  Index: SitemapExecutor.java
  ===================================================================
  /*
   * Copyright 1999-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.cocoon.sitemap;
  
  import java.util.Map;
  
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.acting.Action;
  import org.apache.cocoon.environment.Redirector;
  import org.apache.cocoon.environment.SourceResolver;
  
  /**
   * The sitemap executor executes all sitemap statements, so it actually
   * calls an action, adds a generator to the pipeline etc.
   * By separating this functionality into a single object it is easier to
   * plugin custom profiling or debugging tools.
   *
   * TODO - This is not finished yet!
   * 
   * @since 2.2
   * @version CVS $Id: SitemapExecutor.java,v 1.1 2004/06/09 11:59:23 cziegeler Exp $
   */
  public interface SitemapExecutor {
      
      /** The component role */
      String ROLE = SitemapExecutor.class.getName();
      
      /**
       * Invoke an action and return the result.
       */
      Map invokeAction(ExecutionContext context,
                       Action           action, 
                       Redirector       redirector, 
                       SourceResolver   resolver, 
                       Map              objectModel, 
                       String           resolvedSource, 
                       Parameters       resolvedParams )
      throws Exception;
      
  }
  
  
  
  1.4       +5 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActSetNode.java
  
  Index: ActSetNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActSetNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ActSetNode.java	25 May 2004 13:48:12 -0000	1.3
  +++ ActSetNode.java	9 Jun 2004 11:59:23 -0000	1.4
  @@ -40,6 +40,10 @@
       /** The action set to call */
       private ActionSetNode actionSet;
   
  +    public ActSetNode() {
  +        super(null);
  +    }
  +    
       public void setParameters(Map parameterMap) {
           this.parameters = parameterMap;
       }
  
  
  
  1.8       +23 -8     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java
  
  Index: ActTypeNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ActTypeNode.java	25 May 2004 13:48:12 -0000	1.7
  +++ ActTypeNode.java	9 Jun 2004 11:59:23 -0000	1.8
  @@ -33,7 +33,6 @@
   import org.apache.cocoon.environment.Redirector;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.environment.internal.EnvironmentHelper;
  -import org.apache.cocoon.sitemap.PatternException;
   
   /**
    * Handles <map:act type="..."> (action-sets calls are handled by {@link
ActSetNode}).
  @@ -61,8 +60,10 @@
   
       protected boolean inActionSet;
   
  -    public ActTypeNode(String type, VariableResolver source, String name,
  -            boolean inActionSet) throws PatternException {
  +    public ActTypeNode(String type, 
  +                       VariableResolver source, 
  +                       String name,
  +                       boolean inActionSet)  {
           super(type);
           this.source = source;
           this.name = name;
  @@ -117,13 +118,23 @@
   
           // If action is ThreadSafe, avoid select() and try/catch block (faster !)
           if (this.threadSafeAction != null) {
  -            actionResult = this.threadSafeAction.act(redirector, resolver,
  -                    objectModel, resolvedSource, resolvedParams);
  +            actionResult = this.executor.invokeAction(this, 
  +                                             this.threadSafeAction, 
  +                                             redirector, 
  +                                             resolver, 
  +                                             objectModel, 
  +                                             resolvedSource, 
  +                                             resolvedParams);
           } else {
               Action action = (Action)this.selector.select(this.componentName);
               try {
  -                actionResult = action.act(redirector, resolver,
  -                        objectModel, resolvedSource, resolvedParams);
  +                actionResult = this.executor.invokeAction(this,
  +                                                 action, 
  +                                                 redirector, 
  +                                                 resolver, 
  +                                                 objectModel, 
  +                                                 resolvedSource, 
  +                                                 resolvedParams);
               } finally {
                   this.selector.release(action);
               }
  @@ -159,10 +170,14 @@
           //}
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.avalon.framework.activity.Disposable#dispose()
  +     */
       public void dispose() {
           if (this.threadSafeAction != null) {
               this.selector.release(this.threadSafeAction);
           }
           this.manager.release(this.selector);
       }
  +
   }
  
  
  
  1.5       +2 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNode.java
  
  Index: AggregateNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNode.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AggregateNode.java	5 Mar 2004 13:02:51 -0000	1.4
  +++ AggregateNode.java	9 Jun 2004 11:59:23 -0000	1.5
  @@ -63,6 +63,7 @@
       private Map viewNodes;
   
       public AggregateNode(VariableResolver element, VariableResolver nsURI, VariableResolver
nsPrefix) throws PatternException {
  +        super(null);
           this.element = element;
           this.nsURI = nsURI;
           this.nsPrefix = nsPrefix;
  
  
  
  1.3       +5 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNode.java
  
  Index: CallNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CallNode.java	5 Mar 2004 13:02:51 -0000	1.2
  +++ CallNode.java	9 Jun 2004 11:59:23 -0000	1.3
  @@ -54,6 +54,10 @@
   
       private ProcessingNode resourceNode;
   
  +    public CallNode() {
  +        super(null);
  +    }
  +    
       public void compose(ComponentManager manager) throws ComponentException {
           this.manager = manager;
       }
  
  
  
  1.11      +2 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallFunctionNode.java
  
  Index: CallFunctionNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallFunctionNode.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CallFunctionNode.java	25 May 2004 13:48:12 -0000	1.10
  +++ CallFunctionNode.java	9 Jun 2004 11:59:23 -0000	1.11
  @@ -68,6 +68,7 @@
       }
   
       public CallFunctionNode(VariableResolver functionName, VariableResolver continuationId)
{
  +        super(null);
           this.functionName = functionName;
           this.continuationId = continuationId;
       }
  
  
  
  1.12      +2 -1      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
  
  Index: PipelinesNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PipelinesNode.java	25 May 2004 14:27:32 -0000	1.11
  +++ PipelinesNode.java	9 Jun 2004 11:59:23 -0000	1.12
  @@ -47,6 +47,7 @@
        * Constructor
        */
       public PipelinesNode() {
  +        super(null);
       }
   
       /**
  
  
  
  1.361     +5 -2      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.360
  retrieving revision 1.361
  diff -u -r1.360 -r1.361
  --- status.xml	9 Jun 2004 09:41:16 -0000	1.360
  +++ status.xml	9 Jun 2004 11:59:23 -0000	1.361
  @@ -206,7 +206,10 @@
     <changes>
   
    <release version="@version@" date="@date@">
  -   <action dev="CZ" type="fix">
  +   <action dev="CZ" type="add">
  +     Add profiling/debugging API for the sitemap.
  +   </action>
  +   <action dev="CZ" type="add">
        Add sitemap versioning support to tree processor and remove unused
        support for other tree based languages.
      </action>
  
  
  

Mime
View raw message