Lloyd Chambers wrote:
How does this involve the ORB?
First off, everything in the com.sun.corba.ee package is part of the
ORB in GlassFish, so the ORB code is
involved here.
The reason for all of this comes down to one simple fact: Class.forName
does not work very well under
OSGi. Lots of things in the ORB are configured by class name, plus
there is the fundamental problem of
unmarshaling a value type: when you receive a request containing a
reference to the name of a class,
how do you find the correct instance of the class? This used to be
easy: just use the RMI ClassLoader, which
most often was simply the ClassPath class loader. Now we need a way to
determine which bundles contain
particular classes or packages for these sorts of questions.
Consequently, I added the OSGIListener to the ORB, which listens for
bundle start and stop events and scans
the bundles already registered for two things:
- ORB-Class-Provider entries in the manifest. This allows the ORB
configuration to work normally: if the ORB needs to instantiate a class
by name (say for a standard ORBInitializer), the ORB looks for the
bundle that contains that class name.
- Exported packages using the PackageAdmin interface. This allows
me to extend the ORB class loading mechanisms to look for classes to be
unmarshalled in the packages exposed by bundles. I also have a
URL-like mechanism for doing this.
Ken.