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; }
private void resolveAll() { ServiceRegistration<ResolverHookFactory> registration = context .registerService(ResolverHookFactory.class, (triggers) -> resolver, null); try { context.getBundle().adapt(FrameworkWiring.class) .resolveBundles(Arrays.asList(context.getBundles())); } finally { registration.unregister(); } } }
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; }
public boolean resolveBundles(Bundle[] input) { return container.getFrameworkWiring().resolveBundles(input == null ? null : Arrays.asList(input)); }
public boolean resolveBundles(Bundle[] bundles) { List<Bundle> list = (bundles == null) ? null : Arrays.asList(bundles); return m_felix.adapt(FrameworkWiring.class).resolveBundles(list); } }
Bundle systemBundle = bundleContext.getBundle(0); FrameworkWiring frameworkWiring = systemBundle.adapt(FrameworkWiring.class); frameworkWiring.resolveBundles(Arrays.asList(new Bundle[] {bundle}));
public boolean resolveBundles(Bundle[] input) { return container.getFrameworkWiring().resolveBundles(input == null ? null : Arrays.asList(input)); }
public void resolve() throws MBeanException { getFrameworkWiring().resolveBundles(null); }
public boolean resolveBundles(Bundle[] input) { return container.getFrameworkWiring().resolveBundles(input == null ? null : Arrays.asList(input)); }
public void resolve() throws MBeanException { getFrameworkWiring().resolveBundles(null); }
public boolean resolveBundles(Bundle[] input) { return container.getFrameworkWiring().resolveBundles(input == null ? null : Arrays.asList(input)); }
public boolean resolveBundles(Bundle[] input) { return container.getFrameworkWiring().resolveBundles(input == null ? null : Arrays.asList(input)); }
public boolean resolveBundles(Bundle[] input) { return container.getFrameworkWiring().resolveBundles(input == null ? null : Arrays.asList(input)); }
private ResolutionReport getResolutionReport(Bundle[] bundles) { DiagReportListener reportListener = new DiagReportListener(bundles); ServiceRegistration<ResolverHookFactory> hookReg = context.registerService(ResolverHookFactory.class, reportListener, null); try { Bundle systemBundle = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION); FrameworkWiring frameworkWiring = systemBundle.adapt(FrameworkWiring.class); frameworkWiring.resolveBundles(Arrays.asList(bundles)); return reportListener.getReport(); } finally { hookReg.unregister(); } }
public void resolve(String bundleId) throws MBeanException { try { List<Bundle> bundles = selectBundles(bundleId); getFrameworkWiring().resolveBundles(bundles); } catch (Exception e) { throw new MBeanException(null, e.toString()); } }
public void resolve(String bundleId) throws MBeanException { try { List<Bundle> bundles = selectBundles(bundleId); getFrameworkWiring().resolveBundles(bundles); } catch (Exception e) { throw new MBeanException(null, e.toString()); } }
@Descriptor("resolve bundles") public String resolve( @Descriptor("target bundles (can be null or empty)") Bundle[] bundles) { if (m_b0.adapt(FrameworkWiring.class).resolveBundles(bundles != null ? Arrays.asList(bundles) : null)) { return "Not all bundles could be resolved."; } return null; }
private static Framework startOSGiContainer(final String[] bundleLocations, final String tempDirPath) throws BundleException { FrameworkFactory frameworkFactory = ServiceLoader .load(FrameworkFactory.class).iterator().next(); Map<String, String> config = new HashMap<String, String>(); config.put("osgi.configuration.area", tempDirPath); config.put("osgi.baseConfiguration.area", tempDirPath); config.put("osgi.sharedConfiguration.area", tempDirPath); config.put("osgi.instance.area", tempDirPath); config.put("osgi.user.area", tempDirPath); config.put("osgi.hook.configurators.exclude", "org.eclipse.core.runtime.internal.adaptor.EclipseLogHook"); LQMG.resetFrameworkProperties(); Framework framework = frameworkFactory.newFramework(config); framework.start(); BundleContext systemBundleContext = framework.getBundleContext(); for (String bundleLocation : bundleLocations) { try { systemBundleContext.installBundle(bundleLocation); } catch (BundleException e) { LOGGER.log(Level.WARNING, "Could not start bundle " + bundleLocation, e); } } FrameworkWiring frameworkWiring = framework .adapt(FrameworkWiring.class); frameworkWiring.resolveBundles(null); return framework; }
refreshFinishLock.unlock(); frameworkWiring.resolveBundles(null); Collection<Bundle> bundlesToStart = frameworkWiring.getDependencyClosure(installedBundlesWithStartFlag);
frameworkUtil.hackBundles(osgiContainer, tempDirectory); FrameworkWiring frameworkWiring = osgiContainer.adapt(FrameworkWiring.class); frameworkWiring.resolveBundles(null);