> The OSGi framework does not use a classloader that is a subclass of > URLClassLoader. So serialized object instances will be sent over the > wire to device D2 *without* a URL annotation, that would be used by > RMI running on device D2 to download and load classes dynamically. > So you will get a RemoteException when doing the remote call, whose > underlying cause will be a ClassNotFoundException.
I am working on an RMI alternative solution that should enable me to dynamically download all required classes from bundles in the source device D1. As I gather, Newton dynamically generates remote codebase annotations (using bytecode manipulation?!) when serializing classes to D2 so that the RMI system can utilise this additional information to download the required classes from D1. The essence of my approach is that for each remote service, device D2 is passed a special handler object that knows how to download the required classes from D1. Device D2 then simply use this handler to dynamically obtain the required missing classes. The handler can do all sort of intelligent things and optimisations, for example, downloading multiple classes at a time, downloading and buffering classes before they are actually required by D2, compressing the stream to improve performance etc. All these features are customisable meaning that a handler can still behave similar to RMI in terms of just in time dynamic class loading. Provided that the performance of this solution is comparable or better than RMI, I believe it can be considered more powerful than RMI because of the added features and flexibility. Assuming for now that this solution works, should the handler obtain required classes from bundle B1 only or from both B1 and B2 ? In a previous post describing Newton, David Savage talks about "Dynamic installation of bundles based on unmarshal events" which is exactly my questions. In other words, dynamic installation of bundles means that classes from B2 will not be downloaded and instead B2 will be dynamically installed in D2. I will keep you posted about my progress and hope to provide you with much detailed description soon. regards _______________________________________________ OSGi Developer Mail List [email protected] http://www2.osgi.org/mailman/listinfo/osgi-dev
