Top Description Methods
aQute.bnd.annotation.service

public @Interface ServiceCapability

extends Annotation
Annotations
@Retention:CLASS
@Target:TYPE, PACKAGE
@Repeatable:ServiceCapabilities
@Capability
namespace:osgi.service
attribute:objectClass:List="${uniq;${#value}}", uses:="${if;${size;${#uses}};${#uses};${uniq;${replace;${#value};(.*)\\.[^.]+;$1}}}", ${sjoin;\\;;${#attribute}}
Static Imports
aQute.bnd.annotation.spi.Constants.ATTRIBUTE_MACRO

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.

Method Summary

Modifier and TypeMethod and Description
public String[]
attribute()

A list of attribute or directive names and values.

public Class<?>[]
uses()

A list of classes whose packages are inspected to calculate the uses directive for this capability.

public Class<?>

Returns:

the service type
value
()

The service type.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

attributeback to summary
public String[] attribute()

A 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.
These are added, separated by semicolons, to the osgi.serviceloader capability. Non-standard osgi.serviceloader attributes will be included as service properties to the published service.
usesback to summary
public Class<?>[] uses()

A list of classes whose packages are inspected to calculate the uses directive for this capability.

If not specified, the uses directive is omitted from the capability clause.

valueback to summary
public Class<?> value()

The service type.

Returns:Class<?>

the service type