Using a custom classloader in Spring
actually I try to implement an Spring wrapper around a Apache MINA based RMI alternative.
So far it works quiet fine but there is some problem on reloading the application context since the RMI-System is build on some sort of singleton-like class which holds actual connection sessions.
On reloading these aren't cleaned gracefully so it'll not reconnect but throws an exception cause session isn't opened as it expects.
My idea was to wrap all depending classes to a custom classloader which can be thrown away and recreated on application context reload.
The actual problem is that classes are loaded by BeanDefinitionReader to see if classes are available in classpath.
I know I can instantiate a classloader right before loading Spring but I don't want a special bootstrap thinggy. So is there any other way to inject a custom classloader right before bean configuration is read?
Is there any event or interface that can be used?
Another idea was to define my own namespacehandler and bean definition reader to handle the special classloading stuff but it would be the last chance to get it working since I actually want to be handled it the same way with and without the special namespace.
Hope someone can help me :-)