glassfish
  1. glassfish
  2. GLASSFISH-19395

Mapping HK2 annotations(@Service and @Inject) into OBR capability and requirement

    Details

    • Type: Task Task
    • Status: In Progress
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: future release
    • Fix Version/s: None
    • Component/s: OSGi
    • Labels:
      None

      Description

      While using on-demand provisioning of OSGi modules(glassfish.osgi.ondemand=true), we must discovery and install needed bundle and the bundle's dependencies rightly. In order to reach the goal, only using OBR to generate index file is not enough because HK2 world also defined some annotations which are used for service-level dependencies, called @Service and @Inject.

      Because @Service and @Inject have an another very important task for implementing on-demand bundle's starting, for example, while deploying a WAB with CDI, WebContainer will be started and at the same time, because WebContainer has a @inject JCDIService, deploying phrase will also start Weld-Integration bundle in which a @Service which implements JCDIService will be registered into HK2 registry.

      So, from the point to say, @Service and @Inject also correspond to OBR capability and requirement, if we can not map the annotations, while using OBR to provision, there is an possibility that we will miss some required bundles in felix cache and caused a failure of on-demand starting.

        Activity

        Hide
        TangYong added a comment -

        >I thought approach #3 meant no changes to bundles. We would introspect bundles and generate Export-Service and >Import-Service metadata from @Inject and @Service annotations.

        I see and I will consider it.

        Thanks

        Tang

        Show
        TangYong added a comment - >I thought approach #3 meant no changes to bundles. We would introspect bundles and generate Export-Service and >Import-Service metadata from @Inject and @Service annotations. I see and I will consider it. Thanks Tang
        Hide
        Sanjeeb Sahoo added a comment -

        Assigning to Tang

        Show
        Sanjeeb Sahoo added a comment - Assigning to Tang
        Hide
        TangYong added a comment -

        A new project source has sent into Sahoo and wait for his comment.

        Show
        TangYong added a comment - A new project source has sent into Sahoo and wait for his comment.
        Hide
        TangYong added a comment -

        Have checked in sources.

        revision: 61742

        Show
        TangYong added a comment - Have checked in sources. revision: 61742
        Hide
        TangYong added a comment -

        At revision: 61748(a litter issue's fix)

        Show
        TangYong added a comment - At revision: 61748(a litter issue's fix)

          People

          • Assignee:
            TangYong
            Reporter:
            TangYong
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: