Accessing an OSGi service depends on the type of code (e.g., Spring Bean, OSGi component, etc.) accessing it and the code’s application context.
Accessing Code | Service Access Method |
---|---|
Service Builder code (a Spring Bean) in the service’s application context | an @BeanReference |
Service Builder code (a Spring Bean) outside the service’s application context | an @ServiceReference |
A class in a WAR outside the service’s application context | a ServiceTracker |
An OSGi component outside the service’s application context | an @Reference |