@Retention(value=CLASS) @Target(value={ANNOTATION_TYPE,TYPE}) public @interface ProvideCapability
Since this annotation can only be applied once, it is possible to create an annotation that models a specific capability. For example:
interface Webserver { @ProvideCapability(ns = "osgi.extender", name = "aQute.webserver", version = "${@version}") @interface Provide {} @RequireCapability(ns = "osgi.extender", filter = "(&(osgi.extender=aQute.webserver)${frange;${@version}})") @interface Require {} } @Webserver.Provide public class MyWebserver {}
Modifier and Type | Required Element and Description |
---|---|
String |
ns
The capability namespace.
|
Modifier and Type | Optional Element and Description |
---|---|
String |
effective
Effective time.
|
String[] |
mandatory
Mandatory attributes.
|
String |
name
The name of the capability.
|
String[] |
uses
The uses directive lists package names that are used by this Capability.
|
String |
value
Appended at the end of the clause (after a ';').
|
String |
version
The version of the capability.
|
public abstract String ns
osgi.contract
.public abstract String value
public abstract String name
value()
to be used to specify the name of
the capability, if needed. For example aQute.sse
.public abstract String version
public abstract String effective
public abstract String[] uses
public abstract String[] mandatory
Copyright © 2021 aQute SARL. All rights reserved.