Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M Finkbeiner2012-04-10 17:14:24 -0400
committerRoberto E. Escobar2012-04-10 17:14:24 -0400
commit55554ce1542efc70023e09f27b2e753b5e7484e0 (patch)
treed8b54f3b41b7405215061f525cb9939789f1c3c6 /plugins/org.eclipse.osee.framework.ui.workspacebundleloader
parentddcb03e832be8754818c77a3c361d401f5314e3a (diff)
downloadorg.eclipse.osee-55554ce1542efc70023e09f27b2e753b5e7484e0.tar.gz
org.eclipse.osee-55554ce1542efc70023e09f27b2e753b5e7484e0.tar.xz
org.eclipse.osee-55554ce1542efc70023e09f27b2e753b5e7484e0.zip
refinement: Ensure a bundle is installed before starting it
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.workspacebundleloader')
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/BundleInfoLite.java24
1 files changed, 6 insertions, 18 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 bcd7a531d8..5eff622a21 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
@@ -16,19 +16,13 @@ import org.osgi.framework.BundleException;
public class BundleInfoLite {
-// enum OPERATION {
-// NOOP,NEW,UPDATE,REMOVE
-// }
-
-
private final String symbolicName;
private final String version;
private final URL systemLocation;
private final File file;
private final Manifest manifest;
private byte[] md5Digest;
-// private OPERATION operation;
-private Bundle bundle;
+ private Bundle bundle;
public BundleInfoLite(URL systemLocation) throws IOException {
File tmpFile;
@@ -113,22 +107,16 @@ private Bundle bundle;
return md5Digest;
}
-// void setOperation(OPERATION operation){
-// this.operation = operation;
-// }
-//
-// OPERATION getOperation(){
-// return this.operation;
-// }
-
public void install(BundleContext context) throws BundleException, IOException{
bundle = context.installBundle(this.systemLocation.getFile(), this.getSystemLocation().openStream());
}
public Bundle uninstall() throws BundleException{
- bundle.uninstall();
- System.out.println("uninstall" + toString());
+ if(isInstalled()){
+ bundle.uninstall();
+ }
return bundle;
+
}
public boolean isInstalled() {
@@ -150,7 +138,7 @@ private Bundle bundle;
}
public void start() throws BundleException{
- if(bundle.getState() == Bundle.INSTALLED || bundle.getState() == Bundle.RESOLVED){
+ if(bundle != null && bundle.getState() == Bundle.INSTALLED || bundle.getState() == Bundle.RESOLVED){
bundle.start();
}
}

Back to the top