Changes

Jump to: navigation, search

OSGi Concepts Services

613 bytes added, 08:57, 25 January 2011
no edit summary
{{Ecl_menu}}<h2>OSGi Services</h2>
 
Service Layer
 
The Service Layer provides a dynamic, concise and consistent programming
model for Java bundle developers, simplifying the development and deployment of service bundles by de-coupling the service’s specification (Java
interface) from its implementations. This model allows bundle developers
to bind to services only using their interface specifications. The selection of
a specific implementation, optimized for a specific need or from a specific
vendor, can thus be deferred to run-time (see [http://www.osgi.org/Release4/HomePage OSGi Service Platform]).
:A bundles can register and use services in OSGi. OSGi provides therefore a central registry for this purpose. A service is defined by a Java interface (POJI - Plain Old Java Interface) [http://www.vogella.de/articles/OSGi/article.html#OSGiintro_services].
</source>
 
An implementation of this interface could be:
</source>
Thus, the bundle that provides the service could register its services to an OSGi registry, while the bundle that needs the service could query the registry. The model is Service Oriented Architecture (SOA) inside the JVM (Java Virtual Machine).[[Image:filenameOSGi-DS.png|thumb|widthpx300px| ]]
The bundle consumer must implement the CommandProvider interface

Navigation menu