Package org.osgi.framework

Examples of org.osgi.framework.SynchronousBundleListener


            BundleContext sysContext = framework.getBundleContext();
            MBeanServer mbeanServer = injectedMBeanServer.getValue();
            sysContext.registerService(MBeanServer.class.getName(), mbeanServer, null);

            // Register a {@link SynchronousBundleListener} that removes the {@link DeploymentService}
            BundleListener uninstallListener = new SynchronousBundleListener() {

                @Override
                public void bundleChanged(BundleEvent event) {
                    if (event.getType() == BundleEvent.UNINSTALLED) {
                        AbstractUserBundle userBundle;
View Full Code Here


    // Create a bundle listener that will pull us out of the queue polling loop
    // when the system bundle starts to shutdown
    final AtomicBoolean shutdown = new AtomicBoolean(false);
    final Thread mainThread = Thread.currentThread();
    framework.addBundleListener(new SynchronousBundleListener() {
      public void bundleChanged(BundleEvent event) {
        if(event.getBundle().getBundleId() == 0 && event.getType() == BundleEvent.STOPPING) {
            logger.info("Signalling main thread to stop");
          shutdown.set(true);
          mainThread.interrupt();
View Full Code Here

            installModule(wiring.getClassLoader(), resource, null, null);
        } catch (ModuleException ex) {
            throw new IllegalStateException("Cannot install system module", ex);
        }

        installListener = new SynchronousBundleListener() {
            @Override
            public void bundleChanged(BundleEvent event) {
                int eventType = event.getType();
                Bundle bundle = event.getBundle();
                if (eventType == BundleEvent.RESOLVED) {
View Full Code Here

     * bundle context.
     * @param context the bundle context to use to track bundles.
     **/
    public BundleTracker(BundleContext context) {
        m_context = context;
        m_listener = new SynchronousBundleListener() {
            public void bundleChanged(BundleEvent evt) {
                synchronized (BundleTracker.this) {
                    if (!m_open) { return; }

                    if (evt.getType() == BundleEvent.STARTED) {
View Full Code Here

        ctx.registerService(Main.class.getName(), this, null);
    }

    private void registerBundleDumper(final ModulesRegistry mr) {

        ctx.addBundleListener(new SynchronousBundleListener() {
            public void bundleChanged(final BundleEvent event) {
                switch (event.getType()) {
                    case BundleEvent.RESOLVED:
                        TracingUtilities.traceResolution(mr,
                                event.getBundle().getBundleId(),
View Full Code Here

    final Bundle sampleBundle = bundle;

    final boolean[] listenerCalled = new boolean[] { false };

    // register listener
    bundleContext.addBundleListener(new SynchronousBundleListener() {

      public void bundleChanged(BundleEvent event) {
        // call getResource
        event.getBundle().getResource(LOCATION);
        // call getResources
View Full Code Here

TOP

Related Classes of org.osgi.framework.SynchronousBundleListener

Copyright © 2018 www.massapicom. 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.