this.addURL(pluginJarFile.toURI().toURL());
} catch (MalformedURLException e) {
e.printStackTrace();
throw new IllegalPluginException(e);
}
pluginDescriptor = loadPluginDescriptor();
Class<Runtime> runtimeClass = getRuntimeClass();
Runtime runtime = null;
if (runtimeClass != null) {
try {
runtime = runtimeClass.newInstance();
} catch (Exception e) {
e.printStackTrace();
throw new IllegalPluginException(e);
}
}
File files[] = pluginDirectory.listFiles();
for (File file : files) {
boolean addToClassLoader = true;
if (file.equals(pluginJarFile))
addToClassLoader = false;
else if (runtime != null)
addToClassLoader = runtime.use(file.getName());
if (addToClassLoader) {
try {
this.addURL(file.toURI().toURL());
log.info("["+pluginName+"] loadLibrary=["+file.getName()+"] visibility=PRIVATE");
} catch (MalformedURLException e) {
e.printStackTrace();
throw new IllegalPluginException(e);
}
}
}
dependencyList = new ArrayList<ClassLoader>(2);