* Remove PhantomEngine as it hasn't been in use since 2003.
* Remove FilteredClassloader which relies on PhantomEngine.
This commit is contained in:
parent
b81f231c70
commit
db95fb181c
4 changed files with 6 additions and 117 deletions
|
@ -38,7 +38,7 @@ public class Commandline {
|
|||
try {
|
||||
String installDir = Main.getInstallDir(args);
|
||||
|
||||
FilteredClassLoader loader = Main.createClassLoader(installDir);
|
||||
ClassLoader loader = Main.createClassLoader(installDir);
|
||||
|
||||
// get the main server class
|
||||
Class clazz = loader.loadClass("helma.main.CommandlineRunner");
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* 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.main.launcher;
|
||||
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
||||
/**
|
||||
* ClassLoader that is able to exclude certain packages from loading.
|
||||
*/
|
||||
public class FilteredClassLoader extends URLClassLoader {
|
||||
/**
|
||||
* Create a server wide class loader that doesn't see the scripting engine(s)
|
||||
* embedded in helma.jar. These files should be loaded by the per-application
|
||||
* class loaders so that special security policies can be applied to them and
|
||||
* so that they can load classes from jar files in the app directories.
|
||||
*/
|
||||
public FilteredClassLoader(URL[] urls) {
|
||||
super(urls);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a server wide class loader that doesn't see the scripting engine(s)
|
||||
* embedded in helma.jar. These files should be loaded by the per-application
|
||||
* class loaders so that special security policies can be applied to them and
|
||||
* so that they can load classes from jar files in the app directories.
|
||||
*/
|
||||
public FilteredClassLoader(URL[] urls, ClassLoader parent) {
|
||||
super(urls, parent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mask classes that implement the scripting engine(s) contained in helma.jar
|
||||
*/
|
||||
protected Class findClass(String name) throws ClassNotFoundException {
|
||||
if ((name != null) && (name.startsWith("helma")) &&
|
||||
(name.endsWith("PhantomEngine"))) {
|
||||
throw new ClassNotFoundException(name);
|
||||
}
|
||||
|
||||
return super.findClass(name);
|
||||
}
|
||||
}
|
|
@ -55,7 +55,7 @@ public class Main {
|
|||
try {
|
||||
String installDir = getInstallDir(args);
|
||||
|
||||
FilteredClassLoader loader = createClassLoader(installDir);
|
||||
ClassLoader loader = createClassLoader(installDir);
|
||||
|
||||
// get the main server class
|
||||
Class clazz = loader.loadClass("helma.main.Server");
|
||||
|
@ -83,7 +83,7 @@ public class Main {
|
|||
* @return the main classloader we'll be using
|
||||
* @throws MalformedURLException
|
||||
*/
|
||||
public static FilteredClassLoader createClassLoader(String installDir)
|
||||
public static ClassLoader createClassLoader(String installDir)
|
||||
throws MalformedURLException {
|
||||
|
||||
// decode installDir in case it is URL-encoded
|
||||
|
@ -129,12 +129,12 @@ public class Main {
|
|||
// find out if system classes should be excluded from class path
|
||||
String excludeSystemClasses = System.getProperty("helma.excludeSystemClasses");
|
||||
|
||||
FilteredClassLoader loader;
|
||||
ClassLoader loader;
|
||||
|
||||
if ("true".equalsIgnoreCase(excludeSystemClasses)) {
|
||||
loader = new FilteredClassLoader(urls, null);
|
||||
loader = new URLClassLoader(urls, null);
|
||||
} else {
|
||||
loader = new FilteredClassLoader(urls);
|
||||
loader = new URLClassLoader(urls);
|
||||
}
|
||||
|
||||
// set the new class loader as context class loader
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* This class is filtered out by Helma's main class loader
|
||||
* although it is present in the main helma.jar file. This forces
|
||||
* it to be loaded through the per-application class loader. The
|
||||
* goal is to make jar files in the application directory visible to
|
||||
* application code.
|
||||
*
|
||||
* @see helma.main.launcher.FilteredClassLoader
|
||||
*/
|
||||
public final class PhantomEngine extends RhinoEngine {
|
||||
|
||||
/**
|
||||
* Invoke a function on some object, using the given arguments and global vars.
|
||||
* XML-RPC calls require special input and output parameter conversion.
|
||||
*
|
||||
* @param thisObject the object to invoke the function on, or null for
|
||||
* global functions
|
||||
* @param functionName the name of the function to be invoked
|
||||
* @param args array of argument objects
|
||||
* @param argsWrapMode indicated the way to process the arguments. Must be
|
||||
* one of <code>ARGS_WRAP_NONE</code>,
|
||||
* <code>ARGS_WRAP_DEFAULT</code>,
|
||||
* <code>ARGS_WRAP_XMLRPC</code>
|
||||
* @param resolve indicates whether functionName may contain an object path
|
||||
* or just the plain function name
|
||||
* @return the return value of the function
|
||||
* @throws ScriptingException to indicate something went wrong
|
||||
* with the invocation
|
||||
*/
|
||||
public Object invoke(Object thisObject, String functionName, Object[] args,
|
||||
int argsWrapMode, boolean resolve) throws ScriptingException {
|
||||
return super.invoke(thisObject, functionName, args, argsWrapMode, resolve);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue