org.apache.cocoon.components.flow.javascript.fom
Class AO_FOM_JavaScriptInterpreter
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.flow.AbstractInterpreter
org.apache.cocoon.components.flow.javascript.fom.AO_FOM_JavaScriptInterpreter
- All Implemented Interfaces:
- Configurable, Contextualizable, Disposable, Initializable, Interpreter, LogEnabled, Serviceable, SingleThreaded
- public class AO_FOM_JavaScriptInterpreter
- extends AbstractInterpreter
- implements Serviceable, Configurable, Initializable
Interface with the JavaScript interpreter.
This version of the JavaScript interpreter provides enhanced
functionality and supports interception.
Changes:
- Use of the AO_FOM_Cocoon object encapsulating the Cocoon object.
All references to the FOM_Cocoon object had to be changed.
- Additional configurations
- adding the
JavaScriptAspectWeaver
to the SourceEntry
object if interceptions are enabled
- Since:
- 2.1
- Version:
- CVS $Id: AO_FOM_JavaScriptInterpreter.java 292798 2005-09-30 16:06:38Z sylvain $
- Author:
- Ovidiu Predescu, Marcus Crafter, Christopher Oliver, Reinhard Poetz
Fields inherited from interface org.apache.cocoon.components.flow.Interpreter |
ROLE |
Method Summary |
void |
callFunction(String funName,
List params,
Redirector redirector)
Calls a JavaScript function, passing params as its
arguments. |
protected org.mozilla.javascript.Script |
compileScript(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable scope,
Source src,
JavaScriptAspectWeaver aspectWeaver)
|
void |
configure(Configuration config)
|
void |
forwardTo(org.mozilla.javascript.Scriptable scope,
AO_FOM_Cocoon cocoon,
String uri,
Object bizData,
FOM_WebContinuation fom_wk,
Redirector redirector)
|
void |
handleContinuation(String id,
List params,
Redirector redirector)
Continues a previously started processing. |
void |
initialize()
|
void |
service(ServiceManager manager)
Serviceable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
USER_GLOBAL_SCOPE
public static final String USER_GLOBAL_SCOPE
- Key for storing a JavaScript global scope object in the Cocoon session
- See Also:
- Constant Field Values
INTERCEPTION_POSTFIX
public static final String INTERCEPTION_POSTFIX
- See Also:
- Constant Field Values
lastTimeCheck
protected long lastTimeCheck
- When was the last time we checked for script modifications. Used
only if
AbstractInterpreter.reloadScripts
is true.
AO_FOM_JavaScriptInterpreter
public AO_FOM_JavaScriptInterpreter()
service
public void service(ServiceManager manager)
throws ServiceException
- Description copied from class:
AbstractInterpreter
- Serviceable
- Specified by:
service
in interface Serviceable
- Overrides:
service
in class AbstractInterpreter
- Throws:
ServiceException
configure
public void configure(Configuration config)
throws ConfigurationException
- Specified by:
configure
in interface Configurable
- Overrides:
configure
in class AbstractInterpreter
- Throws:
ConfigurationException
initialize
public void initialize()
throws Exception
- Specified by:
initialize
in interface Initializable
- Throws:
Exception
compileScript
protected org.mozilla.javascript.Script compileScript(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable scope,
Source src,
JavaScriptAspectWeaver aspectWeaver)
throws Exception
- Throws:
Exception
callFunction
public void callFunction(String funName,
List params,
Redirector redirector)
throws Exception
- Calls a JavaScript function, passing
params
as its
arguments. In addition to this, it makes available the parameters
through the cocoon.parameters
JavaScript array
(indexed by the parameter names).
- Specified by:
callFunction
in interface Interpreter
- Parameters:
funName
- a String
valueparams
- a List
valueredirector
-
- Throws:
Exception
- if an error occurs
handleContinuation
public void handleContinuation(String id,
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:
id
- a String
valueparams
- 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
forwardTo
public void forwardTo(org.mozilla.javascript.Scriptable scope,
AO_FOM_Cocoon cocoon,
String uri,
Object bizData,
FOM_WebContinuation fom_wk,
Redirector redirector)
throws Exception
- Throws:
Exception
Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.