ovidiu 02/04/09 23:21:45 Modified: src/scratchpad/schecoon/src/org/apache/cocoon/components/flow/javascript JavaScriptInterpreter.java Log: Make class Configurable. Register the file to be read at startup in configure(). Revision Changes Path 1.3 +12 -1 xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/flow/javascript/JavaScriptInterpreter.java Index: JavaScriptInterpreter.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/flow/javascript/JavaScriptInterpreter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JavaScriptInterpreter.java 10 Apr 2002 00:41:56 -0000 1.2 +++ JavaScriptInterpreter.java 10 Apr 2002 06:21:45 -0000 1.3 @@ -6,6 +6,9 @@ import java.io.Reader; import java.util.List; import org.apache.avalon.framework.activity.Initializable; +import org.apache.avalon.framework.configuration.Configurable; +import org.apache.avalon.framework.configuration.Configuration; +import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.cocoon.components.flow.Interpreter; import org.apache.cocoon.components.flow.AbstractInterpreter; import org.apache.cocoon.components.flow.WebContinuation; @@ -27,13 +30,21 @@ * @since March 25, 2002 */ public class JavaScriptInterpreter extends AbstractInterpreter - implements Initializable + implements Configurable, Initializable { // This is the only optimization level that supports continuations // in the Christoper Oliver's Rhino JavaScript implementation static int OPTIMIZATION_LEVEL = -1; JSGlobal scope; + + public void configure(Configuration config) + { + String loadOnStartup + = config.getChild("load-on-startup", true).getValue(null); + if (loadOnStartup != null) + register(loadOnStartup); + } public void initialize() throws Exception
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]