Package org.apache.cocoon.components.flow

Examples of org.apache.cocoon.components.flow.Interpreter


      = (InterpreterSelector)manager.lookup(Interpreter.ROLE);
    if (language == null)
      language = selector.getDefaultLanguage();
   
    // Obtain the Interpreter instance for this language
    Interpreter interpreter = (Interpreter)selector.select(language);
    interpreter.setResources(resources);
  }
View Full Code Here


      = (InterpreterSelector)manager.lookup(Interpreter.ROLE);
    if (language == null)
      language = selector.getDefaultLanguage();
   
    // Obtain the Interpreter instance for this language
    Interpreter interpreter = (Interpreter)selector.select(language);

    interpreter.callFunction(name, params, env, context);
    return true;
  }
View Full Code Here

    // continuation object? Use the default language for now, but it
    // should be fixed ASAP.
    String language = selector.getDefaultLanguage();

    // Obtain the Interpreter instance for this language
    Interpreter interpreter = (Interpreter)selector.select(language);

    interpreter.handleContinuation(contId, env, context);
    return true;
  }
View Full Code Here

   */
  public void linkNode()
    throws Exception
  {
    FlowNode flowNode = (FlowNode)this.treeBuilder.getRegisteredNode("flow");
    Interpreter interpreter = flowNode.getInterpreter();

    this.node.registerScriptWithInterpreter(interpreter);
  }
View Full Code Here

        if (flow == null)
            throw new ConfigurationException("This sitemap contains no control flows defined, cannot call at " + node.getLocation() + ". Define a control flow using <map:flow>, with embedded <map:script> elements.");

        // Get the Interpreter instance and set it up in the
        // CallFunctionNode function
        Interpreter interpreter = flow.getInterpreter();
        ((CallFunctionNode)node).setInterpreter(interpreter);
      }
    }
View Full Code Here

        // continuation object? Use the default language for now, but it
        // should be fixed ASAP.
        String language = selector.getDefaultLanguage();

        // Obtain the Interpreter instance for this language
        Interpreter interpreter = (Interpreter)selector.select(language);

        try {
            interpreter.handleContinuation(contId, params, PipelinesNode.getRedirector(env));
        } finally {
            selector.release((Component)interpreter);
        }

        return true;
View Full Code Here

    public String callFunction(String type, String source, String function, Map params) throws Exception {
       
        redirector.reset();
       
        ServiceSelector selector = null;
        Interpreter interpreter = null;
        SourceResolver resolver = null;

        try {
            selector = (ServiceSelector) this.lookup(Interpreter.ROLE);
            assertNotNull("Test lookup of interpreter selector", selector);

            resolver = (SourceResolver) this.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if interpreter name is not null", type);
            interpreter = (Interpreter) selector.select(type);
            assertNotNull("Test lookup of interpreter", interpreter);
           
            ((AbstractInterpreter)interpreter).register(source);
           
            ArrayList parameters = new ArrayList();
            for (Iterator i = params.entrySet().iterator(); i.hasNext();) {
                Map.Entry me = (Map.Entry)i.next();
                String name = (String)me.getKey();
                String value = (String)me.getValue();
                parameters.add(new Interpreter.Argument(name, value));
            }
            interpreter.callFunction(function, parameters, getRedirector());
           
        } catch (ServiceException ce) {
            getLogger().error("Could not retrieve interpeter", ce);
            fail("Could not retrieve interpreter: " + ce.toString());
        } finally {
View Full Code Here

    public String callContinuation(String type, String source, String id, Map params) throws Exception {
       
        redirector.reset();
       
        ServiceSelector selector = null;
        Interpreter interpreter = null;
        SourceResolver resolver = null;

        try {
            selector = (ServiceSelector) this.lookup(Interpreter.ROLE);
            assertNotNull("Test lookup of interpreter selector", selector);

            resolver = (SourceResolver) this.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if interpreter name is not null", type);
            interpreter = (Interpreter) selector.select(type);
            assertNotNull("Test lookup of interpreter", interpreter);

            ((AbstractInterpreter)interpreter).register(source);
           
            ArrayList parameters = new ArrayList();
            for (Iterator i = params.entrySet().iterator(); i.hasNext();) {
                Map.Entry me = (Map.Entry)i.next();
                String name = (String)me.getKey();
                String value = (String)me.getValue();
                parameters.add(new Interpreter.Argument(name, value));
            }
            interpreter.handleContinuation(id, parameters, getRedirector());

        } catch (ServiceException ce) {
            getLogger().error("Could not retrieve interpreter", ce);
            fail("Could not retrieve interpreter: " + ce.toString());
        } finally {
View Full Code Here

    public String callFunction(String type, String source, String function, Map params) throws Exception {
       
        redirector.reset();
       
        ServiceSelector selector = null;
        Interpreter interpreter = null;
        SourceResolver resolver = null;

        try {
            selector = (ServiceSelector) this.lookup(Interpreter.ROLE);
            assertNotNull("Test lookup of interpreter selector", selector);

            resolver = (SourceResolver) this.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if interpreter name is not null", type);
            interpreter = (Interpreter) selector.select(type);
            assertNotNull("Test lookup of interpreter", interpreter);
           
            ((AbstractInterpreter)interpreter).register(source);
           
            ArrayList parameters = new ArrayList();
            for (Iterator i = params.entrySet().iterator(); i.hasNext();) {
                Map.Entry me = (Map.Entry)i.next();
                String name = (String)me.getKey();
                String value = (String)me.getValue();
                parameters.add(new Interpreter.Argument(name, value));
            }
            interpreter.callFunction(function, parameters, getRedirector());
           
        } catch (ServiceException ce) {
            getLogger().error("Could not retrieve interpeter", ce);
            fail("Could not retrieve interpreter: " + ce.toString());
        } finally {
View Full Code Here

    public String callContinuation(String type, String source, String id, Map params) throws Exception {
       
        redirector.reset();
       
        ServiceSelector selector = null;
        Interpreter interpreter = null;
        SourceResolver resolver = null;

        try {
            selector = (ServiceSelector) this.lookup(Interpreter.ROLE);
            assertNotNull("Test lookup of interpreter selector", selector);

            resolver = (SourceResolver) this.lookup(SourceResolver.ROLE);
            assertNotNull("Test lookup of source resolver", resolver);

            assertNotNull("Test if interpreter name is not null", type);
            interpreter = (Interpreter) selector.select(type);
            assertNotNull("Test lookup of interpreter", interpreter);

            ((AbstractInterpreter)interpreter).register(source);
           
            ArrayList parameters = new ArrayList();
            for (Iterator i = params.entrySet().iterator(); i.hasNext();) {
                Map.Entry me = (Map.Entry)i.next();
                String name = (String)me.getKey();
                String value = (String)me.getValue();
                parameters.add(new Interpreter.Argument(name, value));
            }
            interpreter.handleContinuation(id, parameters, getRedirector());

        } catch (ServiceException ce) {
            getLogger().error("Could not retrieve interpreter", ce);
            fail("Could not retrieve interpreter: " + ce.toString());
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.cocoon.components.flow.Interpreter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.