Examples of refreshBundles()


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

                }
            }
        };

        FrameworkWiring fwWiring = syscontext.getBundle().adapt(FrameworkWiring.class);
        fwWiring.refreshBundles(Collections.singleton(bundle), listener);

        // Wait for the refresh to complete
        try {
            if (!latch.await(10, TimeUnit.SECONDS)) {
                throw new TimeoutException();
View Full Code Here

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

                }
            }
        };

        FrameworkWiring fwWiring = syscontext.getBundle().adapt(FrameworkWiring.class);
        fwWiring.refreshBundles(Collections.singleton(bundle), listener);

        // Wait for the refresh to complete
        try {
            if (!latch.await(10, TimeUnit.SECONDS)) {
                throw new TimeoutException();
View Full Code Here

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

     */
    static void refresh(BundleContext context, Collection<Bundle> bundles) throws InterruptedException
    {
        final CountDownLatch latch = new CountDownLatch(1);
        FrameworkWiring wiring = context.getBundle(0).adapt(FrameworkWiring.class);
        wiring.refreshBundles(bundles, 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()

    FrameworkWiring framework =
      (FrameworkWiring)system.adapt(FrameworkWiring.class);

    ArrayList<Bundle> bundles = new ArrayList<Bundle>();
    bundles.add(Platform.getBundle("org.eclim.core"));
    framework.refreshBundles(bundles, new FrameworkListener[0]);

    // avoid Services.getMessage due to race condition on reload which can
    // result in a ConcurrentModificationException.
    PluginResources resources = Services.getPluginResources("org.eclim");
    return resources.getMessage("plugins.reloaded");
View Full Code Here

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

    }

    protected void refreshPackages(Collection<Bundle> bundles) throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        FrameworkWiring fw = systemBundleContext.getBundle().adapt(FrameworkWiring.class);
        fw.refreshBundles(bundles, new FrameworkListener() {
            @Override
            public void frameworkEvent(FrameworkEvent event) {
                if (event.getType() == FrameworkEvent.ERROR) {
                    LOGGER.error("Framework error", event.getThrowable());
                }
View Full Code Here

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

                public void frameworkEvent(FrameworkEvent event) {
                    l.countDown();
                }
            };
            FrameworkWiring wiring = (FrameworkWiring) bundleContext.getBundle(0).adapt(FrameworkWiring.class);
            wiring.refreshBundles((Collection<Bundle>) toRefresh, new FrameworkListener[]{listener});
            try {
                l.await();
            } catch (InterruptedException e) {
                throw new PatchException("Bundle refresh interrupted", e);
            }
View Full Code Here

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

        expect(bundle.getState()).andReturn(Bundle.INSTALLED).anyTimes();
        expect(bundle.getRegisteredServices()).andReturn(null);
        expect(sysBundleContext.getBundle(0)).andReturn(sysBundle);
        expect(sysBundle.adapt(FrameworkWiring.class)).andReturn(wiring);
        bundle.start();
        wiring.refreshBundles(eq(asSet(bundle)), anyObject(FrameworkListener[].class));
        expectLastCall().andAnswer(new IAnswer<Object>() {
            @Override
            public Object answer() throws Throwable {
                for (FrameworkListener l : (FrameworkListener[]) (EasyMock.getCurrentArguments()[1])) {
                    l.frameworkEvent(null);
View Full Code Here

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

    }

    public void refreshPackages(Collection<Bundle> bundles) throws InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        FrameworkWiring fw = systemBundleContext.getBundle().adapt(FrameworkWiring.class);
        fw.refreshBundles(bundles, new FrameworkListener() {
            @Override
            public void frameworkEvent(FrameworkEvent event) {
                if (event.getType() == FrameworkEvent.ERROR) {
                    LOGGER.error("Framework error", event.getThrowable());
                }
View Full Code Here

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

    protected Object doExecute(List<Bundle> bundles) throws Exception {
        FrameworkWiring wiring = bundleContext.getBundle(0).adapt(FrameworkWiring.class);
        if (bundles == null || bundles.isEmpty()) {
            bundles = null;
        }
        wiring.refreshBundles(bundles);
        return null;
    }

    @Override
    protected void executeOnBundle(Bundle bundle) throws Exception {
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.