On Mon, Dec 15, 2008 at 7:37 PM, <xor at freenetproject.org> wrote:
> Author: xor
> Date: 2008-12-15 11:37:52 +0000 (Mon, 15 Dec 2008)
> New Revision: 24348
>
> Added:
> trunk/freenet/src/freenet/pluginmanager/FredPluginWithClassLoader.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.
You can get the ClassLoader that load your plugin with
getClass().getClassLoader()
If you really *have* to pass it (which you don't), use the
PluginResperiotr. don't invent yet another interface.
We are implementing way too many interface for each class.
>
> Added: trunk/freenet/src/freenet/pluginmanager/FredPluginWithClassLoader.java
> ===================================================================
> --- trunk/freenet/src/freenet/pluginmanager/FredPluginWithClassLoader.java
> (rev 0)
> +++ trunk/freenet/src/freenet/pluginmanager/FredPluginWithClassLoader.java
> 2008-12-15 11:37:52 UTC (rev 24348)
> @@ -0,0 +1,13 @@
> +package freenet.pluginmanager;
> +
> +/**
> + * A plugin which needs to know its ClassLoader. This is usually necessary
> for db4o.
> + *
> + * @author xor
> + *
> + */
> +public interface FredPluginWithClassLoader {
> +
> + public void setClassLoader(ClassLoader myClassLoader);
> +
> +}
>
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>