Examples of resolveBundles()


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

    protected boolean resolveBundles(Bundle... bundles) throws Exception {
        Bundle systemBundle = m_context.getBundle(0L);

        FrameworkWiring frameworkWiring = systemBundle.adapt(FrameworkWiring.class);
        frameworkWiring.resolveBundles(Arrays.asList(bundles));
       
        for (Bundle bundle : bundles) {
            if ((bundle.getState() & Bundle.RESOLVED) == 0) {
                return false;
            }
View Full Code Here

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

        super(true);
    }

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

}
View Full Code Here

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

    }   
   
    private void startApplicationBundles() throws Exception {
        BundleContext context = bundle.getBundleContext();
        FrameworkWiring wiring = context.getBundle(0).adapt(FrameworkWiring.class);
        if (!wiring.resolveBundles(applicationBundles)) {
            LOG.debug("First resolution of application bundles failed.");
            if (!wiring.resolveBundles(applicationBundles)) {
                throw new BundleException("One or more bundles in " + getApplicationName() + " application could not be resolved.");
            } else {
                LOG.debug("Second resolution of application bundles was successful.");
View Full Code Here

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

    private void startApplicationBundles() throws Exception {
        BundleContext context = bundle.getBundleContext();
        FrameworkWiring wiring = context.getBundle(0).adapt(FrameworkWiring.class);
        if (!wiring.resolveBundles(applicationBundles)) {
            LOG.debug("First resolution of application bundles failed.");
            if (!wiring.resolveBundles(applicationBundles)) {
                throw new BundleException("One or more bundles in " + getApplicationName() + " application could not be resolved.");
            } else {
                LOG.debug("Second resolution of application bundles was successful.");
            }
        }
View Full Code Here

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

            } finally {
                IOUtils.close(in);
            }
           
            // resolve the bundle
            if (!wiring.resolveBundles(bundles)) {
                StringBuilder builder = new StringBuilder();
                builder.append("Updated ").append(bundleName).append(" bundle cannot be resolved.");
               
                // check for resolver errors
                ResolverErrorAnalyzer errorAnalyzer = new ResolverErrorAnalyzer(context);
View Full Code Here

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

            FrameworkWiring wiring = context.getBundle(0).adapt(FrameworkWiring.class);
           
            Collection<Bundle> bundles = Arrays.asList(targetBundle);
           
            // resolve the bundle
            if (!wiring.resolveBundles(bundles)) {
                StringBuilder builder = new StringBuilder();
                builder.append("Updated ").append(bundleName).append(" bundle cannot be resolved.");
               
                // check for resolver errors
                ResolverErrorAnalyzer errorAnalyzer = new ResolverErrorAnalyzer(context);
View Full Code Here

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

    }   
   
    private void startApplicationBundles() throws Exception {
        BundleContext context = bundle.getBundleContext();
        FrameworkWiring wiring = context.getBundle(0).adapt(FrameworkWiring.class);
        if (!wiring.resolveBundles(applicationBundles)) {
            throw new BundleException("One or more bundles in " + getApplicationName() + " application could not be resolved.");
        }
       
        LinkedList<Bundle> bundlesWeStarted = new LinkedList<Bundle>();
        try {
View Full Code Here

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

            ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray());
            Bundle bundle = syscontext.installBundle(archive.getName(), inputStream);

            FrameworkWiring frameworkWiring = syscontext.getBundle().adapt(FrameworkWiring.class);
            if (frameworkWiring.resolveBundles(Arrays.asList(bundle)) == false)
                throw new IllegalStateException("Cannot resolve test bundle - see framework log");

        } catch (RuntimeException rte) {
            throw rte;
        } catch (Exception ex) {
View Full Code Here

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

@Service
public class Resolve extends BundlesCommand {

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

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

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

    }
  }

  protected void startBundles(final List<Bundle> bundles) {
    final FrameworkWiring frameworkWiring = getFramework().adapt(FrameworkWiring.class);
    if (frameworkWiring.resolveBundles(bundles) == false) {
      if (logger.isWarnEnabled()) {
        logger.warn("Could not resolve all {} bundles.", bundles.size());
      }
    }
    for (final Bundle bundle : bundles) {
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.