@Documented @Retention(value=SOURCE) public @interface Service
An instance of this service (if one is registered) can be obtained using
BundleContext#getService(ServiceReference)
or
OSGIUtils#getService(Class)
.
The annotation is meant for service providers that wish to export a new
service via OSGi and not consumers, hence consumers must not mark their
classes or interfaces as @Service
, nor directly extend the classes or
implement the interfaces marked as @Service. Only the bundle(s) that
publishes the service interface/class should do that.
Consumers wanting to extend functionality should make use of
@ExtensionPoint
s instead.
This does not infer any behaviour on a class; this is for documentation purposes only.
ExtensionPoint
Copyright © 2015. All Rights Reserved.