List<String> depends = getDependencyList(jarFile);
// create a classloader for this plugin
// add main classloader
PluginClassLoader pcl = new PluginClassLoader(new URL[] {file.toURL()},
this.getClass().getClassLoader());
// add it to the list
classloaderlist.put(file.getName(), pcl);
// add all dependend classloaders
for(String parent : depends) {
pcl.addParent(classloaderlist.get(parent));
}
// start the plugin class
System.out.println("Open jarfile");
Properties jprop = getJarProperties(jarFile);
String startClass = jprop.getProperty("pluginclass");
System.out.println("Start plugin");
Earth3dPlugin ep = (Earth3dPlugin) pcl.findClass(startClass).newInstance();
ep.setConfiguration(conf);
ep.setExtensionManager(extensionManager);
ep.init();
System.out.println("Started plugin");