dev@glassfish.java.net

Re: [Fwd: Package.getImplementationVersion method in OSGi bundle]

From: Richard S. Hall <heavy_at_ungoverned.org>
Date: Thu, 21 Aug 2008 17:40:23 -0400

This is something that Sahoo brought up within Felix.

One issue is that Felix doesn't currently handle this the way that Sahoo
had envisioned. In Felix we actually tried to map the OSGi version
information into the Package information; thus, we ignored any other
manifest entries relating to this.

Sahoo has reported that he would prefer it if Felix simply obeyed the
manifest entries for the Package metadata and did not try to map OSGi
metadata into it. Currently, this is an RFE at Felix which I am looking
into.

I see no reason why both cannot be supported, since OSGi, by default
ignores the Package entries. However, the OSGi spec doesn't mandate any
behavior in this area so it is not clear that you can 100% rely on it
being the same on every framework.

-> richard

Bill Shannon wrote:
> I didn't see an answer to this...
>
> Can we make the build process create manifest files that have both
> the OSGi version information *and* the version information used by
> java.lang.Package? Please?
>
> I believe Sahoo was going to specify the mapping between the
> different headers involved.
>
>
> Ken Paulsen wrote:
>>
>> Forwarding to the dev alias as others may know or be interested in
>> knowing the answer to this question....
>>
>> Ken
>>
>> ------------------------------------------------------------------------
>>
>> Subject:
>> Package.getImplementationVersion method in OSGi bundle
>> From:
>> Tom Mueller <Tom.Mueller_at_Sun.COM>
>> Date:
>> Thu, 14 Aug 2008 14:18:59 -0500
>> To:
>> Sahoo <sahoo_at_sun.com>
>>
>> To:
>> Sahoo <sahoo_at_sun.com>
>> CC:
>> Anissa Lam <Anissa.Lam_at_Sun.COM>, Ken Paulsen <Ken.Paulsen_at_sun.com>
>>
>>
>> Sahoo,
>>
>> I'm not sure if you are the right person to ask this, but here goes.
>>
>> I'm using the Package.getImplementationVersion method to get the
>> version information out of a JAR file for use in a User-Agent value.
>> This works fine when in a standalone Java process, but when the JAR
>> file is used as an OSGi bundle, I'm getting an empty string return
>> value.
>>
>> Previously, I was calling Class.getProtectionDomain().getCodeSource()
>> in order to get access to the JAR file itself to read the manifest
>> directly, and getCodeSource was returning null when the JAR file is
>> an OSGi module.
>>
>> Are these known problems with the OSGi implementation in GFv3? Should
>> these methods be expected to work when a JAR file is used as an OSGi
>> bundle?
>>
>> Thanks.
>> Tom
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>