org.apache.cocoon.components.flow.javascript.fom
Class FOM_JavaScriptInterpreter
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.flow.AbstractInterpreter
org.apache.cocoon.components.flow.CompilingInterpreter
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter
- All Implemented Interfaces:
- Disposable, Initializable, Component, Configurable, Contextualizable, LogEnabled, Serviceable, SingleThreaded, Interpreter
public class FOM_JavaScriptInterpreter
- extends CompilingInterpreter
- implements Initializable
Interface with the JavaScript interpreter.
- Since:
- March 25, 2002
- Version:
- CVS $Id: FOM_JavaScriptInterpreter.html 1304258 2012-03-23 10:09:27Z ilgrosso $
- Author:
- Ovidiu Predescu, Marcus Crafter
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)
TODO - This is a little bit strange, the interpreter calls
get Script on the ScriptSourceEntry which in turn
calls compileScript on the interpreter. |
void |
configure(Configuration config)
|
void |
forwardTo(org.mozilla.javascript.Scriptable scope,
FOM_Cocoon cocoon,
String uri,
Object bizData,
FOM_WebContinuation fom_wk,
Redirector redirector)
|
protected ServiceManager |
getServiceManager()
Needed to get things working with JDK 1.3. |
void |
handleContinuation(String id,
List params,
Redirector redirector)
Continues a previously started processing. |
void |
initialize()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FOM_JavaScriptInterpreter
public FOM_JavaScriptInterpreter()
getServiceManager
protected ServiceManager getServiceManager()
- Needed to get things working with JDK 1.3. Can be removed once we
don't support that platform any more.
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)
throws Exception
- Description copied from class:
CompilingInterpreter
- TODO - This is a little bit strange, the interpreter calls
get Script on the ScriptSourceEntry which in turn
calls compileScript on the interpreter. I think we
need more refactoring here.
- Specified by:
compileScript
in class CompilingInterpreter
- 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,
FOM_Cocoon cocoon,
String uri,
Object bizData,
FOM_WebContinuation fom_wk,
Redirector redirector)
throws Exception
- Throws:
Exception
Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.