Difference between revisions of "How to use OSGi Services"

From RifidiWiki

Jump to: navigation, search
(New page: They are made available in the OSGi service registry. Services can then be injected using spring's IOC (dependency injection) features in most cases, or looked up directly in the service ...)
 
 
Line 1: Line 1:
They are made available in the OSGi service registry.  Services can then be injected using spring's IOC (dependency injection) features in most cases, or looked up directly in the service registry if need be. It is important that service implement an interface.  The interface should be the only way that other components interact with the service (That is, they should not cast the service back into an implementation object.  This not only defeats the purpose of a service, but with spring it's not even possible since it uses dynamic proxies to create the service in the first place).
+
They are made available in the OSGi service registry.  Services can then be injected using Spring's IOC (dependency injection) features in most cases, or looked up directly in the service registry if needed.
 +
 
 +
It is important that service implement an interface.  The interface should be the only way that other components interact with the service (That is, they should not cast the service back into an implementation object.  This not only defeats the purpose of a service, but with Spring it's not even possible since it uses dynamic proxies to create the service in the first place).

Latest revision as of 14:44, 4 June 2010

They are made available in the OSGi service registry. Services can then be injected using Spring's IOC (dependency injection) features in most cases, or looked up directly in the service registry if needed.

It is important that service implement an interface. The interface should be the only way that other components interact with the service (That is, they should not cast the service back into an implementation object. This not only defeats the purpose of a service, but with Spring it's not even possible since it uses dynamic proxies to create the service in the first place).