org.apache.cocoon.components.flow.apples
Class ApplesProcessor

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.flow.AbstractInterpreter
          extended by org.apache.cocoon.components.flow.apples.ApplesProcessor
All Implemented Interfaces:
Disposable, Component, Configurable, Contextualizable, LogEnabled, Serviceable, SingleThreaded, ContinuationsDisposer, Interpreter

public class ApplesProcessor
extends AbstractInterpreter
implements Serviceable, ContinuationsDisposer

ApplesProcessor is the core Cocoon component that provides the 'Apples' flow implementation.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.cocoon.components.flow.Interpreter
Interpreter.Argument
 
Field Summary
 
Fields inherited from class org.apache.cocoon.components.flow.AbstractInterpreter
avalonContext, checkTime, context, continuationsMgr, manager, needResolve, reloadScripts
 
Fields inherited from interface org.apache.cocoon.components.flow.Interpreter
ROLE
 
Constructor Summary
ApplesProcessor()
           
 
Method Summary
 void callFunction(String className, List params, Redirector redirector)
          This method is called from the sitemap, using the syntax <map:call function="..."
 void disposeContinuation(WebContinuation webContinuation)
          Disposes the passed continuation object.
 void handleContinuation(String continuationId, List params, Redirector redirector)
          Continues a previously started processing.
 void service(ServiceManager serviceManager)
          Serviceable
 
Methods inherited from class org.apache.cocoon.components.flow.AbstractInterpreter
configure, contextualize, dispose, forwardTo, getInterpreterID, process, register, setInterpreterID
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplesProcessor

public ApplesProcessor()
Method Detail

callFunction

public void callFunction(String className,
                         List params,
                         Redirector redirector)
                  throws Exception
Description copied from interface: Interpreter
This method is called from the sitemap, using the syntax
   <map:call function="..."/>
 
The method will execute the named function, which must be defined in the given language. There is no assumption made on how various arguments are passed to the function.

The params argument is a List object that contains Interpreter.Argument instances, representing the parameters to be passed to the called function. An Argument instance is a key-value pair, where the key is the name of the parameter, and the value is its desired value. Most languages will ignore the name value and simply pass to the function, in a positional order, the values of the argument. Some languages however can pass the arguments in a different order than the original prototype of the function. For these languages the ability to associate the actual argument with a formal parameter using its name is essential.

A particular language implementation may decide to put the environment, request, response etc. objects in the dynamic scope available to the function at the time of the call. Other implementations may decide to pass these as arguments to the called function.

The current implementation assumes the sitemap implementation is TreeProcessor.

Specified by:
callFunction in interface Interpreter
Parameters:
className - a String value, the name of the function to call
params - a List object whose components are CallFunctionNode.Argument instances. The interpretation of the parameters is left to the actual implementation of the interpreter.
redirector - a Redirector used to call views
Throws:
Exception

handleContinuation

public void handleContinuation(String continuationId,
                               List params,
                               Redirector redirector)
                        throws Exception
Description copied from interface: Interpreter
Continues a previously started processing. The continuation object where the processing should start from is indicated by the continuationId string.

Specified by:
handleContinuation in interface Interpreter
Parameters:
continuationId - a String value
params - a List value, containing the parameters to be passed when invoking the continuation. As opposed to the parameters passed by callFunction, these parameters will only become available in the language's environment, if at all.
redirector - a Redirector used to call views
Throws:
Exception - if an error occurs

disposeContinuation

public void disposeContinuation(WebContinuation webContinuation)
Description copied from interface: ContinuationsDisposer
Disposes the passed continuation object.

This method is called from the ContinuationsManager in the event of the invalidation of a continuation upon the ContinuationsDisposer object passed during the creation of the WebContinuation.

Specified by:
disposeContinuation in interface ContinuationsDisposer
Parameters:
webContinuation - the WebContinuation value representing the continuation object.

service

public void service(ServiceManager serviceManager)
             throws ServiceException
Description copied from class: AbstractInterpreter
Serviceable

Specified by:
service in interface Serviceable
Overrides:
service in class AbstractInterpreter
Throws:
ServiceException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.