| org.apache.cocoon.components.flow.AbstractInterpreter
All known Subclasses: org.apache.cocoon.components.flow.apples.ApplesProcessor, org.apache.cocoon.components.flow.java.JavaInterpreter, org.apache.cocoon.components.flow.CompilingInterpreter,
AbstractInterpreter | abstract public class AbstractInterpreter extends AbstractLogEnabled implements Component,Serviceable,Contextualizable,Interpreter,SingleThreaded,Configurable,Disposable(Code) | | 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
org.apache.avalon.framework.thread.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.
author: Ovidiu Predescu since: March 15, 2002 version: CVS $Id: AbstractInterpreter.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
public void | configure(Configuration config) | public void | contextualize(org.apache.avalon.framework.context.Context context) | public void | dispose() | public void | forwardTo(String uri, Object bizData, WebContinuation continuation, Redirector redirector) | public String | getInterpreterID() Get the unique ID for this interpreter, which can be used to distinguish user value scopes
attached to the session. | public 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. | public void | register(String source) Registers a source file with the interpreter. | public void | service(ServiceManager sm) | public void | setInterpreterID(String interpreterID) Set the unique ID for this interpreter, which can be used to distinguish user value scopes
attached to the session. |
avalonContext | protected org.apache.avalon.framework.context.Context avalonContext(Code) | | |
checkTime | protected long checkTime(Code) | | Interval between two checks for modified script files. Specified
through the "check-time" XML attribute in flow.xmap .
|
manager | protected ServiceManager manager(Code) | | |
needResolve | protected ArrayList needResolve(Code) | | List of source locations that need to be resolved.
|
reloadScripts | protected boolean reloadScripts(Code) | | Whether reloading of scripts should be done. Specified through
the "reload-scripts" attribute in flow.xmap .
|
AbstractInterpreter | public AbstractInterpreter()(Code) | | |
configure | public void configure(Configuration config) throws ConfigurationException(Code) | | |
contextualize | public void contextualize(org.apache.avalon.framework.context.Context context) throws ContextException(Code) | | |
dispose | public void dispose()(Code) | | |
getInterpreterID | public String getInterpreterID()(Code) | | Get the unique ID for this interpreter, which can be used to distinguish user value scopes
attached to the session.
a unique ID for this interpreter |
process | public void process(String uri, Object biz, OutputStream out) throws Exception(Code) | | Call the Cocoon sitemap for the given URI, sending the output of the
eventually matched pipeline to the specified outputstream.
Parameters: uri - The URI for which the request should be generated. Parameters: biz - Extra data associated with the subrequest. Parameters: out - An OutputStream where the output should be written to. exception: Exception - If an error occurs. |
register | public void register(String source)(Code) | | Registers a source file with the interpreter. Using this method
an implementation keeps track of all the script files which are
compiled. This allows them to reload the script files which get
modified on the file system.
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.
Parameters: source - the location of the script See Also: org.apache.cocoon.environment.Environment See Also: org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper |
service | public void service(ServiceManager sm) throws ServiceException(Code) | | Serviceable
|
setInterpreterID | public void setInterpreterID(String interpreterID)(Code) | | Set the unique ID for this interpreter, which can be used to distinguish user value scopes
attached to the session.
|
|
|