Top Description Methods
aQute.bnd.annotation.headers

public @Interface RequireCapability

extends Annotation
Annotations
@Deprecated
@Retention:CLASS
@Target:ANNOTATION_TYPE, TYPE
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Deprecated

see org.osgi.annotation.bundle.Requirement

The Bundle’s Require-Capability header

Typically used as a meta-annotation, i.e. an annotation placed on another annotation, which we will call the user-defined annotation. When the user-defined annotation is found on a class within the bundle, an entry in the Require-Capability header is added. The filter expression of the requirement may be parameterised with values from the user-defined annotation. For example, given the following declarations:

@RequireCapability( ns = "com.acme.engine", effective = "active", filter = "(com.acme.engine=${type})")
public @interface Engine { String type(); }
@Engine(type = "wankel") public class Vehicle { ... }

... the following header will be generated in MANIFEST.MF:

Require-Capability:\ com.acme.engine; \ effective:=active; \
 filter:="(com.acme.engine=wankel)",\ ...

Method Summary

Modifier and TypeMethod and Description
public String
effective()

Specifies the time a Requirement is considered, either 'resolve' (default) or another name.

public String
public String
filter()

A filter expression that is asserted on the Capabilities belonging to the given namespace.

public String
ns()

The capability namespace.

public Resolution
resolution()
Deprecated

A mandatory Requirement forbids the bundle to resolve when the Requirement is not satisfied; an optional Requirement allows a bundle to resolve even if the Requirement is not satisfied.

public String
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

effectiveback to summary
public String effective()

Specifies the time a Requirement is considered, either 'resolve' (default) or another name. The OSGi framework resolver only considers Requirements without an effective directive or effective:=resolve. Other Requirements can be considered by an external agent. Additional names for the effective directive should be registered with the OSGi Alliance. See OSGi Reference Page

extraback to summary
public String extra()
filterback to summary
public String filter()

A filter expression that is asserted on the Capabilities belonging to the given namespace. The matching of the filter against the Capability is done on one Capability at a time. A filter like (&(a=1)(b=2)) matches only a Capability that specifies both attributes at the required value, not two capabilties that each specify one of the attributes correctly. A filter is optional, if no filter directive is specified the Requirement always matches.

nsback to summary
public String ns()

The capability namespace. For example: osgi.contract.

resolutionback to summary
public Resolution resolution()

Deprecated

A mandatory Requirement forbids the bundle to resolve when the Requirement is not satisfied; an optional Requirement allows a bundle to resolve even if the Requirement is not satisfied. No wirings are created when this Requirement cannot be resolved, this can result in Class Not Found Exceptions when the bundle attempts to use a package that was not resolved because it was optional.

Annotations
@Deprecated
valueback to summary
public String value()