Annotation Interface ExportAsService


@Target({TYPE,FIELD}) @Retention(RUNTIME) public @interface ExportAsService
Denotes a component to be exported as an OSGi service available to other bundles.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The service properties to be exported with this service.
    Class<?>[]
    The interfaces the service should be exported as.
  • Element Details

    • value

      Class<?>[] value
      The interfaces the service should be exported as.

      The default is to export as ALL interfaces implemented by this class, or as the implementation class if it implements no interfaces.

      Returns:
      the list of interfaces to export
      Default:
      {}
    • properties

      ServiceProperty[] properties
      The service properties to be exported with this service.

      Multiple properties can now be added to a service being exported as shown by

      @ExportAsService(

      properties = {@ServiceProperty(key = "my_key", value = "service_with_properties_key")}

      )

      Returns:
      The service properties to be exported with the service
      Since:
      2.2.0
      Default:
      {}