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

Could not add FrameworkListener from ServiceListener

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: framework-3.2.2
    • Fix Version/s: framework-4.0.0
    • Component/s: None
    • Labels:
      None

      Description

      It's now impossible to add a FrameworkListener from ServiceListener in 3.2.x, worked in 3.0.9. The code below hangs in addFrameworkListener when it tries to acquire a global lock on the framework bundle.

      Framework framework = ...
      framework.init();

      final BundleContext ctx = framework.getBundleContext();
      ctx.addServiceListener(new ServiceListener() {
      public void serviceChanged(ServiceEvent event) {
      if (...) {
      ctx.addFrameworkListener(new FrameworkListener() {
      public void frameworkEvent(FrameworkEvent event)

      { System.out.println(event); }

      });
      }
      }
      });

      StartLevel sl = (StartLevel) ctx.getService(ctx.getServiceReference(StartLevel.class.getName()));

      // Install bundles, set start level.
      ...

      framework.start();
      framework.waitForStop();

        Attachments

          Activity

            People

            • Assignee:
              rickhall Richard S. Hall
              Reporter:
              hipa Vlad Arkhipov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: