Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/BundleStarter.java27
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java21
2 files changed, 39 insertions, 9 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/BundleStarter.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/BundleStarter.java
new file mode 100644
index 000000000..aea2fbdc4
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/BundleStarter.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Composent, Inc. and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.util;
+
+import java.util.Arrays;
+import java.util.List;
+import org.osgi.framework.*;
+
+/**
+ * @since 3.9
+ */
+public class BundleStarter {
+
+ public static void startDependents(BundleContext context, String[] bundleSymbolicNames, int stateMask)
+ throws BundleException {
+ List<String> bsns = Arrays.asList(bundleSymbolicNames);
+ for (Bundle b : context.getBundles())
+ if (bsns.contains(b.getSymbolicName()) && ((b.getState() & stateMask) != 0))
+ b.start();
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java
index 363d01f03..701236ca7 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java
@@ -92,16 +92,22 @@ public class Activator implements BundleActivator {
return (DebugOptions) debugOptionsTracker.getService();
}
+ private void startDependents(String[] bundleNames) {
+
+ }
+
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public void start(BundleContext ctxt) throws Exception {
plugin = this;
this.context = ctxt;
+ BundleStarter.startDependents(this.context, new String[] { "org.eclipse.equinox.common",
+ "org.eclipse.core.jobs", "org.eclipse.equinox.concurrent" }, Bundle.STARTING);
+
// Register IIDFactory service
idFactoryServiceRegistration = context.registerService(IIDFactory.class.getName(), IDFactory.getDefault(),
null);
@@ -237,11 +243,9 @@ public class Activator implements BundleActivator {
} catch (final CoreException e) {
getDefault().log(e.getStatus());
} catch (final Exception e) {
- getDefault().log(new Status(IStatus.ERROR, bundleName, FACTORY_NAME_COLLISION_ERRORCODE,
- "name=" //$NON-NLS-1$
- + nsName + ";extension point id=" //$NON-NLS-1$
- + extension.getExtensionPointUniqueIdentifier(),
- null));
+ getDefault().log(new Status(IStatus.ERROR, bundleName, FACTORY_NAME_COLLISION_ERRORCODE, "name=" //$NON-NLS-1$
+ + nsName + ";extension point id=" //$NON-NLS-1$
+ + extension.getExtensionPointUniqueIdentifier(), null));
}
}
}
@@ -266,8 +270,7 @@ public class Activator implements BundleActivator {
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext ctxt) throws Exception {
SafeRunner.run(new ExtensionRegistryRunnable(ctxt) {

Back to the top