[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Declarative Services

Declarative Services (DS) is part of the OSGi specification.  The specification has been implemented by Eclipse's Equinox project. The DS specification is typically implemented as one or more bundles, separately from the core OSGi framework, which is why it appears to be an Eclipse/Equinox component.  You can use Equinox's DS implementation with other OSGi framework implementations.

Your code registers an OSGi service using the BundleContext class' programmatic APIs.  OSGi services can also be registered using the DS by describing the services via a "component"  in XML.  Whether you register an OSGi service via the BundleContext class' programmatic APIs, or via DS makes no difference.  You could very easily take your IImageSegmentation object an register it as a service using DS.  A service is a service no matter how you register it with the OSGi Service Registry.

If you want to learn more about DS, I recommend the following book that has excellent coverage of DS:

Good luck,


From: Santiago Hurtado Gutierrez <s-hurtad@xxxxxxxxxxxxxxx>
To: equinox-dev@xxxxxxxxxxx
Date: 11/03/2010 04:27 PM
Subject: [equinox-dev] Declarative Services
Sent by: equinox-dev-bounces@xxxxxxxxxxx

Hi all

I have been working with JNA for sometime now using c++ components like follows

service = (IImageSegmentation) Native.loadLibrary("SmoothSegmentation", IImageSegmentation.class);
registry = bundleContext.registerService(IImageSegmentation.class.getName(), service, null);

My question is if there is any chance to use them as declarative services, all of this is to maybe be able to use e4

Also I will like to know why the declarative services are a eclipse component and no a OSGi since the specification has DS

Thanks in advance_______________________________________________
equinox-dev mailing list