Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M Finkbeiner2012-04-11 02:57:43 +0000
committerRoberto E. Escobar2012-04-11 02:57:43 +0000
commit53344ba980ae9783fb17f939bb8b4ebb34fd896c (patch)
treeb029377ce1688d9cd6149b6199eef3766760fd72 /plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader
parent61974e8ddc73f6f6ec8b757b7aa6615eb44b0737 (diff)
downloadorg.eclipse.osee-53344ba980ae9783fb17f939bb8b4ebb34fd896c.tar.gz
org.eclipse.osee-53344ba980ae9783fb17f939bb8b4ebb34fd896c.tar.xz
org.eclipse.osee-53344ba980ae9783fb17f939bb8b4ebb34fd896c.zip
bug: Only start the bundle if its already installed
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader')
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/BundleInfoLite.java16
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java2
2 files changed, 14 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/BundleInfoLite.java b/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/BundleInfoLite.java
index 5eff622a214..615563b0c14 100644
--- a/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/BundleInfoLite.java
+++ b/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/BundleInfoLite.java
@@ -8,8 +8,10 @@ import java.net.URL;
import java.security.NoSuchAlgorithmException;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
+import java.util.logging.Level;
import org.eclipse.osee.framework.jdk.core.util.ChecksumUtil;
+import org.eclipse.osee.framework.logging.OseeLog;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -137,10 +139,18 @@ public class BundleInfoLite {
}
}
- public void start() throws BundleException{
- if(bundle != null && bundle.getState() == Bundle.INSTALLED || bundle.getState() == Bundle.RESOLVED){
+ public void start(BundleContext context) throws BundleException{
+ if(bundle == null){
+ for(Bundle findit:context.getBundles()){
+ if(findit.getSymbolicName().equals(getSymbolicName())){
+ findit.start();
+ return;
+ }
+ }
+ OseeLog.log(BundleInfoLite.class, Level.WARNING, String.format("Tried to start bundle [%s] that is not installed.", getSymbolicName()));
+ } else if (bundle.getState() == Bundle.INSTALLED || bundle.getState() == Bundle.RESOLVED){
bundle.start();
- }
+ }
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java b/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java
index f174c663538..1cb7d87b0a3 100644
--- a/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java
+++ b/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/WorkspaceBundleLoadCoordinator.java
@@ -296,7 +296,7 @@ public class WorkspaceBundleLoadCoordinator {
for(BundleInfoLite info:bundles){
if(!info.isStarted()){
try {
- info.start();
+ info.start(context);
} catch (BundleException e) {
}
}

Back to the top