LookupReference
Date: 2016-06-25

org.osgi.service.component.annotations

## Annotation Type LookupReference

-     @Retention(value=CLASS)
      @Target(value={})
      public @interface LookupReference

  Define a lookup strategy reference for a `Component`.

  The referenced service can be accessed using one of the `locateService` methods of `ComponentContext`.

  This annotation is not processed at runtime by a Service Component Runtime implementation. It must be processed by tools and used to add a Component Description to the bundle.

  In the generated Component Description for a component, the references must be ordered in ascending lexicographical order (using `String.compareTo` ) of the reference `name`s.

  Since:
    1.3
  See Also:
    "The reference element of a Component Description."

- - ### Required Element Summary

    Required Elements
    Modifier and Type | Required Element and Description
    --- | ---
    `java.lang.String` | `name` The name of this reference.
    `java.lang.Class<?>` | `service` The type of the service to bind to this reference.

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `ReferenceCardinality` | `cardinality` The cardinality of the reference.
    `ReferencePolicy` | `policy` The policy for the reference.
    `ReferencePolicyOption` | `policyOption` The policy option for the reference.
    `ReferenceScope` | `scope` The requested service scope for this Reference.
    `java.lang.String` | `target` The target filter for the reference.

- - ### Element Detail

    - #### name

          public abstract java.lang.String name

      The name of this reference.
      See Also:
        "The name attribute of the reference element of a Component Description."

    - #### service

          public abstract java.lang.Class<?> service

      The type of the service to bind to this reference.
      See Also:
        "The interface attribute of the reference element of a Component Description."

    - #### cardinality

          public abstract ReferenceCardinality cardinality

      The cardinality of the reference.

      If not specified, the reference has a `1..1` cardinality.

      See Also:
        "The cardinality attribute of the reference element of a Component Description."
      Default:
        org.osgi.service.component.annotations.ReferenceCardinality.MANDATORY

    - #### policy

          public abstract ReferencePolicy policy

      The policy for the reference.

      If not specified, the `STATIC` reference policy is used.

      See Also:
        "The policy attribute of the reference element of a Component Description."
      Default:
        org.osgi.service.component.annotations.ReferencePolicy.STATIC

    - #### target

          public abstract java.lang.String target

      The target filter for the reference.
      See Also:
        "The target attribute of the reference element of a Component Description."
      Default:
        ""

    - #### policyOption

          public abstract ReferencePolicyOption policyOption

      The policy option for the reference.

      If not specified, the `RELUCTANT` reference policy option is used.

      See Also:
        "The policy-option attribute of the reference element of a Component Description."
      Default:
        org.osgi.service.component.annotations.ReferencePolicyOption.RELUCTANT

    - #### scope

          public abstract ReferenceScope scope

      The requested service scope for this Reference.

      If not specified, the `bundle` service scope is requested.

      See Also:
        "The scope attribute of the reference element of a Component Description."
      Default:
        org.osgi.service.component.annotations.ReferenceScope.BUNDLE