Examples of refreshBundles()


Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

                    }
                }
                try {
                    final CountDownLatch latch = new CountDownLatch(1);
                    FrameworkWiring wiring = bundleContext.getBundle(0).adapt(FrameworkWiring.class);
                    wiring.refreshBundles(updated, new FrameworkListener() {
                        public void frameworkEvent(FrameworkEvent event) {
                            latch.countDown();
                        }
                    });
                    latch.await();
View Full Code Here

Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

        this.defaultAllBundles = false;
    }

    protected void doExecute(List<Bundle> bundles) throws Exception {
        FrameworkWiring wiring = getBundleContext().getBundle(0).adapt(FrameworkWiring.class);
        wiring.refreshBundles(bundles == null || bundles.isEmpty() ? null : bundles);
    }

    @Override
    protected void executeOnBundle(Bundle bundle) throws Exception {
    }
View Full Code Here

Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

                                        }
                                        if (rand.nextInt(100) < refresh) {
                                            try {
                                                bundles[b].update();
                                                final CountDownLatch latch = new CountDownLatch(1);
                                                wiring.refreshBundles(Collections.singletonList(bundles[b]), new FrameworkListener() {
                                                    public void frameworkEvent(FrameworkEvent event) {
                                                        latch.countDown();
                                                    }
                                                });
                                                latch.await();
View Full Code Here

Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

                        logger.error("Error updating bundle.", ex);
                    }
                }
                try {
                    final CountDownLatch latch = new CountDownLatch(1);
                    wiring.refreshBundles(updated, new FrameworkListener() {
                        public void frameworkEvent(FrameworkEvent event) {
                            latch.countDown();
                        }
                    });
                    latch.await();
View Full Code Here

Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

    protected void refreshPackages(Collection<Bundle> bundles) {
        final Object refreshLock = new Object();
        FrameworkWiring wiring = bundleContext.getBundle().adapt(FrameworkWiring.class);
        if (wiring != null) {
            synchronized (refreshLock) {
                wiring.refreshBundles(bundles, new FrameworkListener() {
                    public void frameworkEvent(FrameworkEvent event) {
                        if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) {
                            synchronized (refreshLock) {
                                refreshLock.notifyAll();
                            }
View Full Code Here

Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

                                        }
                                        if (rand.nextInt(100) < refresh) {
                                            try {
                                                bundles[b].update();
                                                final CountDownLatch latch = new CountDownLatch(1);
                                                wiring.refreshBundles(Collections.singletonList(bundles[b]), new FrameworkListener() {
                                                    public void frameworkEvent(FrameworkEvent event) {
                                                        latch.countDown();
                                                    }
                                                });
                                                latch.await();
View Full Code Here

Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

    final Object refreshLock = new Object();
    FrameworkWiring wiring = bundleContext.getBundle().adapt(
        FrameworkWiring.class);
    if (wiring != null) {
      synchronized (refreshLock) {
        wiring.refreshBundles(bundles, new FrameworkListener() {
          public void frameworkEvent(FrameworkEvent event) {
            if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) {
              synchronized (refreshLock) {
                refreshLock.notifyAll();
              }
View Full Code Here

Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

                }
            }
           
            // refresh the bundle and its dependents
            RefreshListener refreshListener = new RefreshListener();
            wiring.refreshBundles(bundles, refreshListener);
            refreshListener.waitForRefresh(bundleRefreshTimeout);

            // start the bundle
            if (BundleUtils.canStart(targetBundle)) {
                targetBundle.start(Bundle.START_TRANSIENT);
View Full Code Here

Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

        // refresh
        expect(bundleContext.getBundle(0)).andStubReturn(sysBundle);
        expect(sysBundle.adapt(FrameworkWiring.class)).andStubReturn(frameworkWiring);
        final Capture<FrameworkListener> listeners =  new Capture<FrameworkListener>();
        frameworkWiring.refreshBundles(EasyMock.<Collection<Bundle>>eq(null), capture(listeners));
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                for (FrameworkListener listener : listeners.getValues()) {
                    listener.frameworkEvent(new FrameworkEvent(FrameworkEvent.PACKAGES_REFRESHED, sysBundle, null));
                }
View Full Code Here

Examples of org.osgi.framework.wiring.FrameworkWiring.refreshBundles()

        // refresh
        expect(bundleContext.getBundle(0)).andStubReturn(sysBundle);
        expect(sysBundle.adapt(FrameworkWiring.class)).andStubReturn(frameworkWiring);
        final Capture<FrameworkListener> listeners =  new Capture<FrameworkListener>();
        frameworkWiring.refreshBundles(EasyMock.<Collection<Bundle>>eq(null), capture(listeners));
        expectLastCall().andStubAnswer(new IAnswer<Object>() {
            public Object answer() throws Throwable {
                for (FrameworkListener listener : listeners.getValues()) {
                    listener.frameworkEvent(new FrameworkEvent(FrameworkEvent.PACKAGES_REFRESHED, sysBundle, null));
                }
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.