| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.flow.AbstractInterpreter
public abstract class AbstractInterpreter
Abstract superclass for various scripting languages used by Cocoon for flow control. Defines some useful behavior like the ability to reload script files if they get modified (useful when doing development), and passing the control to Cocoon's sitemap for result page generation.
 Flow intrepreters belonging to different sitemaps should be isolated. To achieve this,
 class implements the SingleThreaded. Since
 the sitemap engine looks up the flow intepreter once at sitemap build time, this ensures
 that each sitemap will use a different instance of this class. But that instance will
 handle all flow calls for a given sitemap, and must therefore be thread safe.
| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from interface org.apache.cocoon.components.flow.Interpreter | 
|---|
| Interpreter.Argument | 
| Field Summary | |
|---|---|
| protected  Context | avalonContext | 
| protected  long | checkTimeInterval between two checks for modified script files. | 
| protected  Context | context | 
| protected  ContinuationsManager | continuationsMgr | 
| protected  ServiceManager | manager | 
| protected  ArrayList | needResolveList of source locations that need to be resolved. | 
| protected  boolean | reloadScriptsWhether reloading of scripts should be done. | 
| Fields inherited from interface org.apache.cocoon.components.flow.Interpreter | 
|---|
| ROLE | 
| Constructor Summary | |
|---|---|
| AbstractInterpreter() | |
| Method Summary | |
|---|---|
|  void | configure(Configuration config) | 
|  void | contextualize(Context context) | 
|  void | dispose() | 
|  void | forwardTo(String uri,
          Object bizData,
          WebContinuation continuation,
          Redirector redirector)Forward the request to a Cocoon pipeline. | 
|  String | getInterpreterID()Get the unique ID for this interpreter, which can be used to distinguish user value scopes attached to the session. | 
|  void | process(String uri,
        Object biz,
        OutputStream out)Call the Cocoon sitemap for the given URI, sending the output of the eventually matched pipeline to the specified outputstream. | 
|  void | register(String source)Registers a source file with the interpreter. | 
|  void | service(ServiceManager sm)Serviceable | 
|  void | setInterpreterID(String interpreterID)Set the unique ID for this interpreter, which can be used to distinguish user value scopes attached to the session. | 
| 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 | 
| Methods inherited from interface org.apache.cocoon.components.flow.Interpreter | 
|---|
| callFunction, handleContinuation | 
| Field Detail | 
|---|
protected Context avalonContext
protected ArrayList needResolve
protected Context context
protected ServiceManager manager
protected ContinuationsManager continuationsMgr
protected boolean reloadScripts
flow.xmap.
protected long checkTime
flow.xmap.
| Constructor Detail | 
|---|
public AbstractInterpreter()
| Method Detail | 
|---|
public void setInterpreterID(String interpreterID)
setInterpreterID in interface Interpreterpublic String getInterpreterID()
getInterpreterID in interface Interpreter
public void configure(Configuration config)
               throws ConfigurationException
configure in interface ConfigurableConfigurationException
public void service(ServiceManager sm)
             throws ServiceException
service in interface ServiceableServiceException
public void contextualize(Context context)
                   throws ContextException
contextualize in interface ContextualizableContextExceptionpublic void dispose()
dispose in interface Disposablepublic void register(String source)
The parsing/compilation of a script file by an interpreter
 happens in two phases. In the first phase the file's location is
 registered in the needResolve array.
 
The second is possible only when a Cocoon
 Environment is passed to the Interpreter. This
 allows the file location to be resolved using Cocoon's
 SourceFactory class.
 
Once a file's location can be resolved, it is removed from the
 needResolve array and placed in the
 scripts hash table. The key in this hash table is
 the file location string, and the value is a
 DelayedRefreshSourceWrapper instance which keeps track of when
 the file needs to re-read.
source - the location of the scriptEnvironment, 
DelayedRefreshSourceWrapper
public void process(String uri,
                    Object biz,
                    OutputStream out)
             throws Exception
uri - The URI for which the request should be generated.biz - Extra data associated with the subrequest.out - An OutputStream where the output should be written to.
Exception - If an error occurs.
public void forwardTo(String uri,
                      Object bizData,
                      WebContinuation continuation,
                      Redirector redirector)
               throws Exception
Interpreter
forwardTo in interface Interpreteruri - a String, the URI of the forwarded requestbizData - an Object, the business data object
 to be made available to the forwarded pipelinecontinuation - a WebContinuation, the
 continuation to be called to resume the processingredirector - a Redirector used to call views
Exception - if an error occurs| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||