Top Description Inners Methods
org.osgi.annotation.bundle

public @Interface Export

extends Annotation
Annotations
@Documented
@Retention:CLASS
@Target:PACKAGE
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target, org.osgi.annotation.versioning.ConsumerType, .ProviderType, .Version

Mark a package to be exported from its bundle.

The package must also be annotation with the Version annotation to specify the export version of the package.

This annotation is not retained at runtime. It is for use by tools to generate bundle manifests or otherwise process the package.

Author
$Id: 07e458dc13fd696af03961131a4fd91ac7c02774 $

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Export.Substitution

Substitution policy for this package.

Method Summary

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

A list of attribute or directive names and values.

public String
substitution()

Specify the policy for substitutably importing this package.

public String[]
uses()

A list of package names that are used by this package.

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 export package clause.
substitutionback to summary
public String substitution()

Specify the policy for substitutably importing this package.

Bundles that collaborate require the same class loader for types used in the collaboration. If multiple bundles export packages with collaboration types then they will have to be placed in disjoint class spaces, making collaboration impossible. Collaboration is significantly improved when bundles are willing to import exported packages; these imports will allow a framework to substitute exports for imports.

If not specified, the Substitution#CALCULATED substitution policy is used for this package.

usesback to summary
public String[] uses()

A list of package names that are used by this package.

If the uses directive must be omitted from the export package clause for this package, the empty value {} must be specified.

If not specified, the uses directive for the export package clause is calculated by inspection of the classes in this package.

org.osgi.annotation.bundle back to summary

public final Class Export.Substitution

extends Object
Class Inheritance

Substitution policy for this package.

Field Summary

Modifier and TypeField and Description
public static final String
CALCULATED

The policy value is calculated by inspection of the classes in the package.

public static final String
CONSUMER

Use a consumer type version range for the import package clause when substitutably importing a package.

public static final String
NOIMPORT

The package must not be substitutably imported.

public static final String
PROVIDER

Use a provider type version range for the import package clause when substitutably importing a package.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CALCULATEDback to summary
public static final String CALCULATED

The policy value is calculated by inspection of the classes in the package.

CONSUMERback to summary
public static final String CONSUMER

Use a consumer type version range for the import package clause when substitutably importing a package.

See Also
ConsumerType
NOIMPORTback to summary
public static final String NOIMPORT

The package must not be substitutably imported.

PROVIDERback to summary
public static final String PROVIDER

Use a provider type version range for the import package clause when substitutably importing a package.

See Also
ProviderType

Constructor Detail

Substitutionback to summary
private Substitution()