Author: xor
Date: 2008-12-15 11:30:18 +0000 (Mon, 15 Dec 2008)
New Revision: 24347

Modified:
   trunk/freenet/src/freenet/pluginmanager/PluginManager.java
Log:
Add code to allow plugins to know their ClassLoader. Db4o does not work in some 
cases if it has a different ClassLoader than the ClassLoader which was used for 
the classes which db4o should store the objects of.

Modified: trunk/freenet/src/freenet/pluginmanager/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginManager.java  2008-12-15 
11:05:39 UTC (rev 24346)
+++ trunk/freenet/src/freenet/pluginmanager/PluginManager.java  2008-12-15 
11:30:18 UTC (rev 24347)
@@ -751,6 +751,9 @@
                                pluginFile.delete();
                                throw new PluginNotFoundException("plugin main 
class is not a plugin");
                        }
+                       if(object instanceof FredPluginWithClassLoader) {
+                               
((FredPluginWithClassLoader)object).setClassLoader(jarClassLoader);
+                       }
                        return (FredPlugin) object;
                } catch(IOException ioe1) {
                        Logger.error(this, "could not load plugin", ioe1);

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to