Examples of addFrameworkListener()


Examples of org.osgi.framework.BundleContext.addFrameworkListener()

                    sem.release();
                  }
                }
              };
       
              ctx.addFrameworkListener(listener);
              pa.refreshPackages(null);
       
              try {
                sem.tryAcquire(60, TimeUnit.SECONDS);
              } catch (InterruptedException ie) {}
View Full Code Here

Examples of org.osgi.framework.BundleContext.addFrameworkListener()

    }

    public void testStartDoesNotFailWithOneInvalidUri()  {
        BundleContext bundleContext = EasyMock.createMock(BundleContext.class);
        expect(bundleContext.getDataFile(EasyMock.<String>anyObject())).andReturn(dataFile).anyTimes();
        bundleContext.addFrameworkListener(EasyMock.<FrameworkListener>anyObject());
        bundleContext.removeFrameworkListener(EasyMock.<FrameworkListener>anyObject());
        replay(bundleContext);
        FeaturesServiceImpl service = new FeaturesServiceImpl();
        service.setBundleContext(bundleContext);
        try {
View Full Code Here

Examples of org.osgi.framework.BundleContext.addFrameworkListener()

      BundleContext felixBudleContext = felix.getBundleContext();

      AutoProcessor.process(otherProps, felixBudleContext);
      // listen to errors
      felixBudleContext.addFrameworkListener(frameworkErrorListener);
      felixBudleContext.addBundleListener(myBundleListener);
      // Now start Felix instance.
      felix.start();
      System.out.println("felix started");
View Full Code Here

Examples of org.osgi.framework.BundleContext.addFrameworkListener()

    // So we need to cope with multiple equinox frameworks, so we can't just listen to our
    // BundleContext. Instead we add a listener to Bundle 0 of the framework bundle associated
    // with the bundle passed in.
    BundleContext ctx = b.getBundleContext().getBundle(0).getBundleContext();
    ctx.addBundleListener(this);
    ctx.addFrameworkListener(this);
  }

  private synchronized ClassLoader put(Bundle b, ClassLoader cl)
  {
    // If the bundle is uninstalled or installed then there is no classloader so we should
View Full Code Here

Examples of org.osgi.framework.BundleContext.addFrameworkListener()

        // The listener must be registered on the system bundle; registering it on the bundle
        // passed as parameter won't work because a stopping bundle can't receive asynchronous events.
        BundleContext systemBundleContext = bundle.getBundleContext().getBundle(0).getBundleContext();
        Listener listener = new Listener(bundle);
        // Need a framework listener to intercept errors that would otherwise end up only being logged
        systemBundleContext.addFrameworkListener(listener);
        systemBundleContext.addBundleListener(listener);
        try {
            // Note: the stop method may also throw exceptions
            bundle.stop();
            listener.check();
View Full Code Here

Examples of org.osgi.framework.BundleContext.addFrameworkListener()

        // So we need to cope with multiple equinox frameworks, so we can't just listen to our
        // BundleContext. Instead we add a listener to Bundle 0 of the framework bundle associated
        // with the bundle passed in.
        BundleContext ctx = b.getBundleContext().getBundle(0).getBundleContext();
        ctx.addBundleListener(this);
        ctx.addFrameworkListener(this);
    }

    private synchronized ClassLoader put(Bundle b, ClassLoader cl) {
        // If the bundle is uninstalled or installed then there is no classloader so we should
        // just return null. This is a last second sanity check to avoid memory leaks that could
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.