Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-11919

[osgi-mock] Support R8 field injection of type Optional

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Testing OSGi Mock 3.3.8
    • Testing OSGi Mock 3.3.10
    • Testing
    • None

    Description

      The OSGi R8 Declarative Services specification allows a component's field of type Optional to be annotated with @Reference. In this case the cardinality defaults to OPTIONAL and depending on the presence of the service an empty Optional, or an Optional holding the service, is injected.

      Injecting fields of type Optional should be supported in osgi-mock.

      See also https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.component.html#service.component-field.injection

      cc sseifert

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              jsedding Julian Sedding
              jsedding Julian Sedding
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: