Author: reinhard Date: Thu Dec 16 02:34:29 2004 New Revision: 122541 URL: http://svn.apache.org/viewcvs?view=rev&rev=122541 Log: Use new CompilingClassloader in Flowscript too Modified: cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
Modified: cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java?view=diff&rev=122541&p1=cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java&r1=122540&p2=cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java&r2=122541 ============================================================================== --- cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java (original) +++ cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java Thu Dec 16 02:34:29 2004 @@ -298,41 +298,6 @@ } } - private ClassLoader getClassLoader(boolean needsRefresh) throws Exception { - if (!reloadScripts) { - return Thread.currentThread().getContextClassLoader(); - } - - synchronized (javaClassRepository) { - boolean reload = needsRefresh || classLoader == null; - if (needsRefresh && classLoader != null) { - reload = !javaClassRepository.upToDateCheck(); - } - - if (reload) { - // FIXME FIXME FIXME Resolver not released! - classLoader = new CompilingClassLoader( - Thread.currentThread().getContextClassLoader(), - (SourceResolver) manager.lookup(SourceResolver.ROLE), - javaClassRepository); - classLoader.addSourceListener( - new CompilingClassLoader.SourceListener() { - public void sourceCompiled(Source src) { - // no action - } - - public void sourceCompilationError(Source src, String msg) { - if (src != null) { - throw Context.reportRuntimeError(msg); - } - } - }); - updateSourcePath(); - } - return classLoader; - } - } - private void updateSourcePath() { if (classLoader != null) { classLoader.setSourcePath(javaSourcePath); @@ -562,9 +527,7 @@ // We need to setup the FOM_Cocoon object according to the current // request. Everything else remains the same. - ClassLoader classLoader = getClassLoader(needsRefresh); - Thread.currentThread().setContextClassLoader(classLoader); - thrScope.setupPackages(classLoader); + thrScope.setupPackages(Thread.currentThread().getContextClassLoader()); cocoon.pushCallContext(this, redirector, manager, avalonContext, getLogger(), null);