Serge,


In theory all the jars in blocks/ and lib/ directory should be loaded via the same ClassLoader (However we experimented with a few things re ClassLoader a bit back so that may have caused issues). So in theory you should be able to do something like the following.


BlockContext context = ...;
File homeDir = context.getHomeDirectory();
File classesDir = new File( homeDir, "classes" );
URL[] urls = new URL[] { classesDir.toURL() };

ClassLoader parent = James.class.getClassLoader();

URLClassLoader classloader = URLClassLoader.newInstance( urls, parent );

then in theory you should be able to load mailets/matchers out of this classloader. You should also be able to throw it away later and reload it all providing that all matchers/mailets are in classes/ directory.

I can vouch for this as it works for Jesktop like this. It you are using Fede's Store then you'll have to be careful with the classloader there too.

- Paul


-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Reply via email to