You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2003/07/19 17:24:59 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap FlowNode.java

joerg       2003/07/19 08:24:59

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        FlowNode.java
  Log:
  replaced deprecated ComponentException constructor
  
  Revision  Changes    Path
  1.3       +53 -63    cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNode.java
  
  Index: FlowNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FlowNode.java	16 Mar 2003 17:49:13 -0000	1.2
  +++ FlowNode.java	19 Jul 2003 15:24:59 -0000	1.3
  @@ -66,69 +66,59 @@
    * @version CVS $Id$
    */
   public class FlowNode extends AbstractProcessingNode
  -  implements Composable, Contextualizable
  -{
  -  ComponentManager manager;
  -  String language;
  -  Context context;
  -  Interpreter interpreter;
  -
  -  public FlowNode(String language)
  -  {
  -    this.language = language;
  -  }
  -  
  -  /**
  -   * This method should never be called by the TreeProcessor, since a
  -   * <code>&lt;map:flow&gt;</code> element should not be in an
  -   * "executable" sitemap node.
  -   *
  -   * @param env an <code>Environment</code> value
  -   * @param context an <code>InvokeContext</code> value
  -   * @return a <code>boolean</code> value
  -   * @exception Exception if an error occurs
  -   */
  -  public boolean invoke(Environment env, InvokeContext context)
  -    throws Exception
  -  {
  -    return true;
  -  }
  -
  -  public void contextualize(org.apache.avalon.framework.context.Context context)
  -    throws ContextException
  -  {
  -    this.context = (Context)context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
  -  }
  -
  -  /**
  -   *
  -   * Lookup an flow {@link
  -   * org.apache.cocoon.components.flow.Interpreter} instance to hold
  -   * the scripts defined within the <code>&lt;map:flow&gt;</code> in
  -   * the sitemap.
  -   *
  -   * @param manager a <code>ComponentManager</code> value
  -   */
  -  public void compose(ComponentManager manager)
  -    throws ComponentException
  -  {
  -    this.manager = manager;
  -    
  -    try {
  -      ComponentSelector selector
  -        = (ComponentSelector)manager.lookup(Interpreter.ROLE);
  -      // Obtain the Interpreter instance for this language
  -      interpreter = (Interpreter)selector.select(language);
  +        implements Composable, Contextualizable {
  +
  +    ComponentManager manager;
  +    String language;
  +    Context context;
  +    Interpreter interpreter;
  +
  +    public FlowNode(String language) {
  +        this.language = language;
       }
  -    catch (Exception ex) {
  -      throw new ComponentException("ScriptNode: Couldn't obtain a flow "
  -                                   + "interpreter for " + language
  -                                   + ": " + ex);
  +
  +    /**
  +     * This method should never be called by the TreeProcessor, since a
  +     * <code>&lt;map:flow&gt;</code> element should not be in an
  +     * "executable" sitemap node.
  +     *
  +     * @param env an <code>Environment</code> value
  +     * @param context an <code>InvokeContext</code> value
  +     * @return a <code>boolean</code> value
  +     * @exception Exception if an error occurs
  +     */
  +    public boolean invoke(Environment env, InvokeContext context) throws Exception {
  +        return true;
  +    }
  +
  +    public void contextualize(org.apache.avalon.framework.context.Context context)
  +        throws ContextException {
  +        this.context = (Context)context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
       }
  -  }
   
  -  public Interpreter getInterpreter()
  -  {
  -    return interpreter;
  -  }
  +    /**
  +     *
  +     * Lookup an flow {@link org.apache.cocoon.components.flow.Interpreter}
  +     * instance to hold the scripts defined within the <code>&lt;map:flow&gt;</code>
  +     * in the sitemap.
  +     *
  +     * @param manager a <code>ComponentManager</code> value
  +     * @exception ComponentException if no flow interpreter could be obtained
  +     */
  +    public void compose(ComponentManager manager) throws ComponentException {
  +        this.manager = manager;
  +
  +        try {
  +            ComponentSelector selector = (ComponentSelector)manager.lookup(Interpreter.ROLE);
  +            // Obtain the Interpreter instance for this language
  +            interpreter = (Interpreter)selector.select(language);
  +        } catch (Exception ex) {
  +            throw new ComponentException(language,
  +                "ScriptNode: Couldn't obtain a flow interpreter for " + language + ": " + ex);
  +        }
  +    }
  +
  +    public Interpreter getInterpreter() {
  +        return interpreter;
  +    }
   }