How to use OSGi Services

From RifidiWiki

Jump to: navigation, search

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).

Personal tools