Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1295

ServiceRegistry increments/decrements service use count after/before getService/ungetService() is called on ServiceFactory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • framework-1.8.1
    • framework-2.0.0
    • Framework
    • None

    Description

      The OSGi specification says about the call to BundleContext.getService():

      "1 If the service has been unregistered, null is returned.
      2 The context bundle's use count for this service is incremented by one.
      3 If the context bundle's use count for the service is currently one and the
      service was registered with an object implementing the ServiceFactory
      interface, the ServiceFactory.getService(Bundle, ServiceRegistration)
      method is called to create a service object for the context bundle."

      The OSGi specification says about the call to ServiceFactory.ungetService():

      "The bundle's usage count for that service object must drop to zero
      after this call returns; that is, the bundle is about to release its last
      dependency on the service object."

      However, the current implementation decrements it just after ServiceFactory.getService() and just before ServiceFactory.ungetService().

      Attachments

        Issue Links

          Activity

            People

              rickhall Richard S. Hall
              bosschaert David Bosschaert
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: