Implement phantom engine classloader trick for rhino

This commit is contained in:
hns 2003-06-26 16:52:05 +00:00
parent a70ace86bd
commit 084b0e8e6c
3 changed files with 35 additions and 2 deletions

View file

@ -42,7 +42,8 @@ public class FilteredClassLoader extends URLClassLoader {
* Mask classes that implement the scripting engine(s) contained in helma.jar * Mask classes that implement the scripting engine(s) contained in helma.jar
*/ */
protected Class findClass(String name) throws ClassNotFoundException { protected Class findClass(String name) throws ClassNotFoundException {
if ((name != null) && "helma.scripting.fesi.PhantomEngine".equals(name)) { if ((name != null) && (name.startsWith("helma")) &&
(name.endsWith("PhantomEngine"))) {
throw new ClassNotFoundException(name); throw new ClassNotFoundException(name);
} }

View file

@ -0,0 +1,32 @@
/*
* Helma License Notice
*
* The contents of this file are subject to the Helma License
* Version 2.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://adele.helma.org/download/helma/license.txt
*
* Copyright 1998-2003 Helma Software. All Rights Reserved.
*
* $RCSfile$
* $Author$
* $Revision$
* $Date$
*/
package helma.scripting.rhino;
import helma.scripting.ScriptingException;
/**
*
*/
public final class PhantomEngine extends RhinoEngine {
/**
*
*/
public Object invoke(Object thisObject, String functionName, Object[] args,
boolean xmlrpc) throws ScriptingException {
return super.invoke(thisObject, functionName, args, xmlrpc);
}
}

View file

@ -35,7 +35,7 @@ import java.util.*;
/** /**
* This is the implementation of ScriptingEnvironment for the Mozilla Rhino EcmaScript interpreter. * This is the implementation of ScriptingEnvironment for the Mozilla Rhino EcmaScript interpreter.
*/ */
public final class RhinoEngine implements ScriptingEngine { public class RhinoEngine implements ScriptingEngine {
// map for Application to RhinoCore binding // map for Application to RhinoCore binding
static Map coreMap; static Map coreMap;