Relationship to JSR 291 [was: Re: Bryan's comments]

Richard S.Hall heavy at UNGOVERNED.ORG
Thu May 31 15:53:26 PDT 2007


On May 31, 2007, at 6:35 PM, Stanley M. Ho wrote:

> Richard S. Hall wrote:
>> ...
>> I am not so sure supporting #3 is as straight forward as you suggest
>> here. Specially, the OSGi modularity layer [for the most part]
>> assumes that packages are atomic units; there is no way to specify
>> that your export or import something smaller than a package. Since
>> 277 modules declare exports in terms of classes, it is not clear how
>> we would know if a 277 module was exporting an entire package. This
>> would, at a minimum, require that we assume we can inspect the
>> contents of the module and see that the contents of a contained
>> package matches the module's export signature for that package.
> My assumption for #3 is that if an OSGi bundle attempts to import
> package x.y.z and if the OSGi framework wants to resolve such
> dependency
> using 277 modules, it can search all the modules in the repositories to
> find out which module have exported classes that are in package x.y.z.
> After the appropriate 277 module has been identified, the OSGi
> framework
> can do whatever is needed to wire that 277 module. Obviously, searching
> modules in the repositories this way may not be very efficient, and it
> may make sense to have some convenience methods in this case to make it
> easier for querying modules by package name.
> I don't think I fully understand your concerns around exporting an
> entire package. As you mentioned, what's get exported in 277 module is
> in terms of classes and the information is in the module metadata, and
> I
> think we can probably determine the packages associated with these
> exported classes and treat these packages as "exported packages" from
> the OSGi perspective. There is no split package allowed in 277 module,
> so I think each of these exported packages would be an entire package.

The point is that an OSGi exported package FOO specifically means that
all public classes in the FOO package are accessible to importers. Such
an export is not the same as a 277 module that just happens to export a
class in its export signature from the FOO package. Without cracking
open the module, there is no way to tell if its export signature
contains all public classes from the FOO package (i.e., the entire

-> richard

More information about the jsr277-eg-observer mailing list