|
|
@ -23,8 +23,8 @@ import java.util.List; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class PluginClassLoader extends URLClassLoader { |
|
|
|
public class PluginClassLoader extends URLClassLoader { |
|
|
|
|
|
|
|
|
|
|
|
private static final String JAVA_PACKAGE_PREFIX = "java."; |
|
|
|
// private static final String JAVA_PACKAGE_PREFIX = "java.";
|
|
|
|
private static final String JAVAX_PACKAGE_PREFIX = "javax."; |
|
|
|
// private static final String JAVAX_PACKAGE_PREFIX = "javax.";
|
|
|
|
private static final String PLUGIN_PACKAGE_PREFIX = "ro.fortsoft.pf4j."; |
|
|
|
private static final String PLUGIN_PACKAGE_PREFIX = "ro.fortsoft.pf4j."; |
|
|
|
|
|
|
|
|
|
|
|
private PluginManager pluginManager; |
|
|
|
private PluginManager pluginManager; |
|
|
@ -46,10 +46,13 @@ public class PluginClassLoader extends URLClassLoader { |
|
|
|
public Class<?> loadClass(String className) throws ClassNotFoundException { |
|
|
|
public Class<?> loadClass(String className) throws ClassNotFoundException { |
|
|
|
// System.out.println(">>>" + className);
|
|
|
|
// System.out.println(">>>" + className);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
// javax.mail is not in JDK ?!
|
|
|
|
// first check whether it's a system class, delegate to the system loader
|
|
|
|
// first check whether it's a system class, delegate to the system loader
|
|
|
|
if (className.startsWith(JAVA_PACKAGE_PREFIX) || className.startsWith(JAVAX_PACKAGE_PREFIX)) { |
|
|
|
if (className.startsWith(JAVA_PACKAGE_PREFIX) || className.startsWith(JAVAX_PACKAGE_PREFIX)) { |
|
|
|
return findSystemClass(className); |
|
|
|
return findSystemClass(className); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
// second check whether it's already been loaded
|
|
|
|
// second check whether it's already been loaded
|
|
|
|
Class<?> loadedClass = findLoadedClass(className); |
|
|
|
Class<?> loadedClass = findLoadedClass(className); |
|
|
|