@Retention(value=CLASS) @Target(value=TYPE) @Repeatable(value=ServiceProviders.class) @Capability(name="${#value}", namespace="osgi.serviceloader", attribute={"register:=${@class}","${if;${size;${#uses}};uses:=\'${#uses}\'}","${sjoin;\\;;${#attribute}}"}) @Requirement(name="osgi.serviceloader.registrar", namespace="osgi.extender", version="1.0.0", attribute={"${if;${size;${#effective}};effective:=${#effective}}","${if;${is;${#resolution};default};;resolution:=${#resolution}}"}) public @interface ServiceProvider
Also results in the automatic generation of service descriptor files (a.k.a.
META-INF/services).
| Modifier and Type | Required Element and Description |
|---|---|
Class<?> |
value
The service type.
|
| Modifier and Type | Optional Element and Description |
|---|---|
String[] |
attribute
A list of attribute or directive names and values.
|
String |
effective
The effective time of the
osgi.extender requirement. |
Resolution |
resolution
The resolution policy of the
osgi.extender requirement. |
Class<?>[] |
uses
A list of classes whose packages are inspected to calculate the
uses directive for this capability. |
public abstract Class<?> value
public abstract String effective
osgi.extender requirement.
Specifies the time the osgi.extender requirements are available.
The OSGi framework resolver only considers requirements without an
effective directive or effective:=resolve. Requirements with
other values for the effective directive can be considered by an external
agent.
If not specified, the effective directive is omitted from the
requirement clause.
public abstract Class<?>[] uses
uses directive for this capability.
If not specified, the uses directive is omitted from the
capability clause.
public abstract String[] attribute
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-standard
osgi.serviceloader attributes will be included as service
properties to the published service.public abstract Resolution resolution
osgi.extender requirement.
A mandatory requirement forbids the bundle to resolve when this requirement is not satisfied; an optional requirement allows a bundle to resolve even if this requirement is not satisfied.
If not specified, the resolution directive is omitted from the
requirement clause.
Copyright © 2021. All rights reserved.