RMI question
Hello.
I am writing an RMI server class that accepts an array of objects as a parameter, and returns the same array of objects (it need to return them because RMI calls are by value). These objects are instances of classes that are loaded with a custom class loader on the client side. The class loader has a URL that is also accessible on the server side, so in principle it should be possible to recreate the objects there.
There are two problems with this:
1. The RMI deserializer on the server side doesn't know about the custom class loader.
2. The RMI deserializer on the client side doesn't know about the custom class loader.
For both 1. and 2., it should be easy to subclass ObjectInputStream, and overload resolveClass to call the custom class loader. But how do you plug this class into the RMI skeleton?
All comments will be greatly appreciated.
I am writing an RMI server class that accepts an array of objects as a parameter, and returns the same array of objects (it need to return them because RMI calls are by value). These objects are instances of classes that are loaded with a custom class loader on the client side. The class loader has a URL that is also accessible on the server side, so in principle it should be possible to recreate the objects there.
There are two problems with this:
1. The RMI deserializer on the server side doesn't know about the custom class loader.
2. The RMI deserializer on the client side doesn't know about the custom class loader.
For both 1. and 2., it should be easy to subclass ObjectInputStream, and overload resolveClass to call the custom class loader. But how do you plug this class into the RMI skeleton?
All comments will be greatly appreciated.
