Ok,

I'll try it. thanks !

On 09/06/2016 12:58, BJ Hargrave wrote:
As long as the impl bundle both exports and imports the package, then it should not matter. Both you, the consumer, and the impl, the provider, should using the same package.
--

BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com

    ----- Original message -----
    From: Cristiano Gavião <cvgav...@gmail.com>
    Sent by: osgi-dev-boun...@mail.osgi.org
    To: osgi-dev@mail.osgi.org
    Cc:
    Subject: Re: [osgi-dev] Orientation about programming with
    optionality in mind ?
    Date: Thu, Jun 9, 2016 11:42 AM

    hi Peter,

    thanks...

    one last doubt.

    what can I do to ensure that my bundle will still be binding to
    packages from the osgi alliance's api jars instead those provided
    by the implementation jar when I install them ?

    regards,

    Cristiano
    On 09/06/2016 07:00, Peter Kriens wrote:
    The compendium services are now available as separate JARs so you
    can install one of those for the  APIs you don’t want an
    implementation for a specific API.

    Never install the compendium JAR.

    Kind regards,

            Peter Kriens


    On 9 jun. 2016, at 00:38, Cristiano Gavião <cvgav...@gmail.com>
    <mailto:cvgav...@gmail.com> wrote:

    Hello,

    I have a bundle containing some DS components and I would like
    to have different behaviour whether Preference Service bundle
    (and other compedium services) is available or not.

    First thing I did was to declare the import of
    org.osgi.service.prefs package as optional in the manifest and
    then set the component's service reference cardinality to
    ReferenceCardinality.OPTIONAL.

    But it quickly turns out that this is not enough... I got a
    NoClassDefFoundError as soon as I started the container.

    Well, if I understood right what happened, I need to have at
    least a bundle providing the API classes installed. right ?

    So, what would be the best approach when the implementation is
    also packed and delivered with the API in one bundle, as it is
    the case of Felix ones. or in cases where it is not, as is the
    case with Equinox?
    should I pack those required packages with my own bundle also?
    or use the new api binary bundles provided by osgi alliance?

    any tip is welcome.

    many thanks,

    Cristiano
    _______________________________________________
    OSGi Developer Mail List
    osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>
    https://mail.osgi.org/mailman/listinfo/osgi-dev

    _______________________________________________
    OSGi Developer Mail List
    osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>
    https://mail.osgi.org/mailman/listinfo/osgi-dev
    _______________________________________________
    OSGi Developer Mail List
    osgi-dev@mail.osgi.org
    https://mail.osgi.org/mailman/listinfo/osgi-dev




_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to