Search code examples
javaapache-flexblazedsclassloader

How to use Blazeds with a custom classloader?


has anybody tried using a custom classloader with BlazeDS?

We have a web application using BlazeDS and we can convert Java objects in to ActionScript object and back without problems in the main application. However, we also have a plug-in mechanism based on a custom classloader. BlazeDS cannot map the types contained in jar files of that custom classloader since I don't know how to tell it to BlazeDS. Has anybody already done this?

The livedocs of TypeMarshallingcontext show a setClassloader() method, but since the context seems to be a singleton, I assume this will not work if you have multiple custom classloaders (we have 1 for each plugin that is deployed)

regards,

Wim


Solution

  • I never did that, but I think you can build a custom Classloader which will delegate the findclass method to the children cloassloaders (and check if they are to find it or not), and set this classloader in the TypeMarshallingContext.