0 Replies Latest reply on Aug 27, 2009 8:49 AM by thomas.diesler

    Invalid delivery of framework events

    thomas.diesler

      https://jira.jboss.org/jira/browse/JBOSGI-140

      Although a listener is associated with a bundle context (i.e. must get removed when the bundle gets uninstalled) the events must get delivered to the listeners that are associated with the framework.

      sysContext.addBundleListener(listenerA);

      Bundle bndA = sysContext.install("bundleA.jar");
      bndA.getBundleContext()..addBundleListener(listenerB);

      Bundle bndB = sysContext.install("bundleB.jar");
      bndB.uninstall();

      Both listenerA and listenerB must see the BundleEvents for bundleB.

      This delivery pattern is the basis of the much used "Extender Pattern"