Package aQute.bnd.annotation.service
Annotation Interface ServiceCapability
@Retention(CLASS)
@Target({TYPE,PACKAGE})
@Repeatable(ServiceCapabilities.class)
@Capability(namespace="osgi.service",
attribute={"objectClass:List<String>=\"${uniq;${#value}}\"","uses:=\"${if;${size;${#uses}};${#uses};${uniq;${replace;${#value};(.*)\\.[^.]+;$1}}}\"","${sjoin;\\;;${#attribute}}"})
public @interface ServiceCapability
Adds a ProvideCapability for a service. This is useful to the resolver, when
a service is registered manually. It can annotate a class or a package. If it
annotates a class without specifying a value, the class will be named as the
registered service. Uses constraints will be calculated automatically.
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
Class<?> valueThe service type.- Returns:
- the service type
- Default:
- java.lang.annotation.Target.class
-
uses
Class<?>[] usesA list of classes whose packages are inspected to calculate theuses
directive for this capability.If not specified, the
uses
directive is omitted from the capability clause.- Default:
- {}
-
attribute
String[] attributeA list of attribute or directive names and values.Each string should be specified in the form:
"name=value"
for attributes."name:type=value"
for typed attributes."name:=value"
for directives.
osgi.serviceloader
capability. Non-standardosgi.serviceloader
attributes will be included as service properties to the published service.- Default:
- {}
-