private Bundle getBundle(GoPluginDescriptor pluginDescriptor, File bundleLocation) { Bundle bundle = null; try { bundle = framework.getBundleContext().installBundle("reference:" + bundleLocation.toURI()); pluginDescriptor.setBundle(bundle); bundle.start(); if (pluginDescriptor.isInvalid()) { handlePluginInvalidation(pluginDescriptor, bundleLocation, bundle); return bundle; } IterableUtils.forEach(pluginChangeListeners, notifyPluginLoadedEvent(pluginDescriptor)); return bundle; } catch (Exception e) { pluginDescriptor.markAsInvalid(asList(e.getMessage()), e); LOGGER.error("Failed to load plugin: {}", bundleLocation, e); handlePluginInvalidation(pluginDescriptor, bundleLocation, bundle); throw new RuntimeException("Failed to load plugin: " + bundleLocation, e); } }
public static void start(Bundle bundle) throws BundleException { int originalState = bundle.getState(); if ((originalState & Bundle.ACTIVE) != 0) return; // bundle is already active try { // attempt to activate the bundle bundle.start(Bundle.START_TRANSIENT); } catch (BundleException e) { if ((originalState & Bundle.STARTING) != 0 && (bundle.getState() & Bundle.STARTING) != 0) // This can happen if the bundle was in the process of being activated on this thread, just return return; throw e; } } }
public void start(String bundleSymbolicName) throws BundleException, InvalidSyntaxException { Bundle currentBundle = getBundle(bundleSymbolicName); System.out.println("Starting " + bundleSymbolicName + "; id: " + currentBundle.getBundleId() + " ..."); currentBundle.start(); System.out.println("Started!"); }
if (b != null) b.start();
((Bundle) startBundleList.get(i)).start();
public void startAll(List<Bundle> bundles) throws BundleException { for (Bundle b : bundles) { b.start(); } }
public Object run() throws BundleException { bundle.start(Bundle.START_TRANSIENT); return null; } });
@Override public void startBundle(Bundle bundle) throws BundleException { if (bundle != this.ourBundle || bundle.getState() != Bundle.STARTING) { bundle.start(); } }
List<Bundle> installedBundles = new ArrayList<Bundle>(); for (URL url : urls) { installedBundles.add(context.installBundle(url.toString())); } for (Bundle bundle : installedBundles) { bundle.start(); }
public void installBundle(String bundleLocation, boolean start) throws Exception { Bundle bundle = bundleContext.installBundle(bundleLocation); if (start) { bundle.start(); } }
private void startBundle(Bundle bundle, BundleType bundleType) throws BundleException { if (LOG.isDebugEnabled()) { LOG.debug("Starting {} {}", new String[]{bundleType.name(), bundle.getSymbolicName()}); } bundle.start(); }
public void startService(Long [] id) { try { bc.getBundle(id[0].longValue()).start(); } catch (BundleException e) { e.printStackTrace(); } }
private static void startBundle(Bundle bundle, int options) { try { bundle.start(options); } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } }
private static void startBundle(Bundle bundle, int options) { try { bundle.start(options); } catch (BundleException e) { if ((bundle.getState() & Bundle.RESOLVED) != 0) { // only log errors if the bundle is resolved FrameworkLogEntry entry = new FrameworkLogEntry(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, 0, NLS.bind(Msg.ECLIPSE_STARTUP_FAILED_START, bundle.getLocation()), 0, e, null); log.log(entry); } } }
public long install(String url, boolean start) throws MBeanException { try { Bundle bundle = bundleContext.installBundle(url, null); if (start) { bundle.start(); } return bundle.getBundleId(); } catch (Exception e) { throw new MBeanException(null, e.toString()); } }
public void start(String bundleId) throws MBeanException { try { List<Bundle> bundles = selectBundles(bundleId); for (Bundle bundle : bundles) { bundle.start(); } } catch (Exception e) { throw new MBeanException(null, e.toString()); } }
private void startBundle(String bsn, boolean required) throws BundleException { PackageAdmin pa = packageAdminTracker.getService(); if (pa != null) { @SuppressWarnings("deprecation") Bundle[] shells = pa.getBundles(bsn, null); if (shells != null && shells.length > 0) { shells[0].start(Bundle.START_TRANSIENT); } else if (required) { throw new BundleException("Missing required bundle: " + bsn); } } }
public void restart(String bundleId) throws MBeanException { try { List<Bundle> bundles = selectBundles(bundleId); for (Bundle bundle : bundles) { bundle.stop(); bundle.start(); } } catch (Exception e) { throw new MBeanException(null, e.toString()); } }
public void restart(String bundleId) throws MBeanException { try { List<Bundle> bundles = selectBundles(bundleId); for (Bundle bundle : bundles) { bundle.stop(); bundle.start(); } } catch (Exception e) { throw new MBeanException(null, e.toString()); } }
@Override public void enablePlugin(PluginMetadata pluginMetadata) { try { felix.getBundleContext().getBundle(pluginMetadata.getId()).start(); logger.warning("Started bundle " + pluginMetadata.getName()); } catch (BundleException e) { logger.log(Level.SEVERE, "Failed to start plugin " + pluginMetadata.getName(), e); throw new PluginManagementException(e); } }