|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.util.AbstractLogEnabled org.apache.cocoon.components.flow.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 inherited from class org.apache.cocoon.components.flow.Interpreter |
org.apache.cocoon.components.flow.Interpreter.Argument |
Field Summary | |
protected Context |
avalonContext
|
protected long |
checkTime
Interval between two checks for modified script files. |
protected org.apache.cocoon.components.flow.ContinuationsManager |
continuationsMgr
|
protected ServiceManager |
manager
|
protected ArrayList |
needResolve
List of source locations that need to be resolved. |
protected org.apache.cocoon.el.objectmodel.ObjectModel |
newObjectModel
|
protected org.apache.cocoon.processing.ProcessInfoProvider |
processInfoProvider
|
protected boolean |
reloadScripts
Whether reloading of scripts should be done. |
protected org.apache.cocoon.configuration.Settings |
settings
The settings of Cocoon. |
Fields inherited from interface org.apache.cocoon.components.flow.Interpreter |
ROLE |
Constructor Summary | |
AbstractInterpreter()
|
Method Summary | |
void |
configure(Configuration config)
|
void |
contextualize(Context aContext)
|
void |
dispose()
|
void |
forwardTo(String uri,
Object bizData,
org.apache.cocoon.components.flow.WebContinuation continuation,
org.apache.cocoon.environment.Redirector redirector)
|
String |
getInterpreterID()
Get the unique ID for this interpreter, which can be used to distinguish user value scopes attached to the session. |
String |
getScriptExtension()
|
void |
register(String source)
Registers a source file with the interpreter. |
void |
service(ServiceManager sm)
|
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.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
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 ServiceManager manager
protected org.apache.cocoon.components.flow.ContinuationsManager continuationsMgr
protected org.apache.cocoon.processing.ProcessInfoProvider processInfoProvider
protected org.apache.cocoon.el.objectmodel.ObjectModel newObjectModel
protected org.apache.cocoon.configuration.Settings settings
protected boolean reloadScripts
flow.xmap
.
protected long checkTime
flow.xmap
.
Constructor Detail |
public AbstractInterpreter()
Method Detail |
public void setInterpreterID(String interpreterID)
setInterpreterID
in interface org.apache.cocoon.components.flow.Interpreter
public String getInterpreterID()
getInterpreterID
in interface org.apache.cocoon.components.flow.Interpreter
public void configure(Configuration config) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)
public void service(ServiceManager sm) throws ServiceException
service
in interface Serviceable
ServiceException
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
public void contextualize(Context aContext) throws ContextException
contextualize
in interface Contextualizable
ContextException
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)
public void dispose()
dispose
in interface Disposable
Disposable.dispose()
public 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.
register
in interface org.apache.cocoon.components.flow.Interpreter
source
- the location of the scriptEnvironment
,
DelayedRefreshSourceWrapper
public void forwardTo(String uri, Object bizData, org.apache.cocoon.components.flow.WebContinuation continuation, org.apache.cocoon.environment.Redirector redirector) throws Exception
forwardTo
in interface org.apache.cocoon.components.flow.Interpreter
Exception
Interpreter.forwardTo(java.lang.String, java.lang.Object, org.apache.cocoon.components.flow.WebContinuation, org.apache.cocoon.environment.Redirector)
public String getScriptExtension()
getScriptExtension
in interface org.apache.cocoon.components.flow.Interpreter
Interpreter.getScriptExtension()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |