org.apache.cocoon.components.flow
Class CompilingInterpreter

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.flow.AbstractInterpreter
          extended byorg.apache.cocoon.components.flow.CompilingInterpreter
All Implemented Interfaces:
Configurable, Contextualizable, Disposable, org.apache.cocoon.components.flow.Interpreter, Serviceable, SingleThreaded
Direct Known Subclasses:
FOM_JavaScriptInterpreter

public abstract class CompilingInterpreter
extends org.apache.cocoon.components.flow.AbstractInterpreter

This is a base class for all interpreters compiling the scripts

Version:
$Id: CompilingInterpreter.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Nested Class Summary
protected  class CompilingInterpreter.ScriptSourceEntry
           
 
Nested classes inherited from class org.apache.cocoon.components.flow.Interpreter
org.apache.cocoon.components.flow.Interpreter.Argument
 
Field Summary
protected  Map compiledScripts
          Mapping of String objects (source uri's) to ScriptSourceEntry's
protected  SourceResolver sourceresolver
          A source resolver
 
Fields inherited from class org.apache.cocoon.components.flow.AbstractInterpreter
avalonContext, checkTime, continuationsMgr, manager, needResolve, newObjectModel, processInfoProvider, reloadScripts, settings
 
Fields inherited from interface org.apache.cocoon.components.flow.Interpreter
ROLE
 
Constructor Summary
CompilingInterpreter()
           
 
Method Summary
protected abstract  org.mozilla.javascript.Script compileScript(org.mozilla.javascript.Context context, org.mozilla.javascript.Scriptable scope, Source source)
          TODO - This is a little bit strange, the interpreter calls CompilingInterpreter.ScriptSourceEntry.compile(org.mozilla.javascript.Context, org.mozilla.javascript.Scriptable) which in turn calls this compileScript mthod on the interpreter.
 void dispose()
           
 void service(ServiceManager manager)
           
 
Methods inherited from class org.apache.cocoon.components.flow.AbstractInterpreter
configure, contextualize, forwardTo, getInterpreterID, getScriptExtension, register, setInterpreterID
 
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

sourceresolver

protected SourceResolver sourceresolver
A source resolver


compiledScripts

protected final Map compiledScripts
Mapping of String objects (source uri's) to ScriptSourceEntry's

Constructor Detail

CompilingInterpreter

public CompilingInterpreter()
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Throws:
ServiceException
See Also:
Serviceable.service(ServiceManager)

dispose

public void dispose()

compileScript

protected abstract org.mozilla.javascript.Script compileScript(org.mozilla.javascript.Context context,
                                                               org.mozilla.javascript.Scriptable scope,
                                                               Source source)
                                                        throws Exception
TODO - This is a little bit strange, the interpreter calls CompilingInterpreter.ScriptSourceEntry.compile(org.mozilla.javascript.Context, org.mozilla.javascript.Scriptable) which in turn calls this compileScript mthod on the interpreter. I think we need more refactoring here.

Throws:
Exception


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.