Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M Finkbeiner2012-06-01 15:45:42 +0000
committerRoberto E. Escobar2012-06-01 15:45:42 +0000
commit4132bcff39f7e5765cb1ee1d0e6345214c5cc57f (patch)
treeac90635f0a26a7cd195bae5fcd59b73e0928ba1f /plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org
parent9d3544c1b33196efd979e94c16de8b0f86edcb61 (diff)
downloadorg.eclipse.osee-4132bcff39f7e5765cb1ee1d0e6345214c5cc57f.tar.gz
org.eclipse.osee-4132bcff39f7e5765cb1ee1d0e6345214c5cc57f.tar.xz
org.eclipse.osee-4132bcff39f7e5765cb1ee1d0e6345214c5cc57f.zip
refinement[ats_19NDL]: Uninstall workspace bundles on shutdown
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org')
-rw-r--r--plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/SafeWorkspaceTracker.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/SafeWorkspaceTracker.java b/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/SafeWorkspaceTracker.java
index a8a0aa158e..3f5ded052e 100644
--- a/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/SafeWorkspaceTracker.java
+++ b/plugins/org.eclipse.osee.framework.ui.workspacebundleloader/src/org/eclipse/osee/framework/ui/workspacebundleloader/SafeWorkspaceTracker.java
@@ -23,6 +23,9 @@ import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.plugin.core.util.OseeData;
import org.eclipse.osee.framework.ui.plugin.workspace.SafeWorkspaceAccess;
import org.eclipse.osee.framework.ui.workspacebundleloader.internal.Activator;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchListener;
+import org.eclipse.ui.PlatformUI;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
@@ -30,7 +33,7 @@ import org.osgi.util.tracker.ServiceTracker;
/**
* @author Andrew M. Finkbeiner
*/
-public class SafeWorkspaceTracker extends ServiceTracker implements IJarChangeListener<WorkspaceStarterNature>, WorkspaceLoader {
+public class SafeWorkspaceTracker extends ServiceTracker implements IJarChangeListener<WorkspaceStarterNature>, WorkspaceLoader, IWorkbenchListener {
private JarChangeResourceListener<WorkspaceStarterNature> workspaceListener;
private SafeWorkspaceAccess service;
@@ -40,6 +43,7 @@ public class SafeWorkspaceTracker extends ServiceTracker implements IJarChangeLi
super(context, SafeWorkspaceAccess.class.getName(), null);
bundleCoordinator = new WorkspaceBundleLoadCoordinator(new File(OseeData.getPath().toFile(), "loadedbundles"));
context.registerService(WorkspaceLoader.class.getName(), this, null);
+ PlatformUI.getWorkbench().addWorkbenchListener(this);
}
@Override
@@ -68,6 +72,7 @@ public class SafeWorkspaceTracker extends ServiceTracker implements IJarChangeLi
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
workspace.addResourceChangeListener(workspaceListener);
+
}
}
@@ -127,4 +132,14 @@ public class SafeWorkspaceTracker extends ServiceTracker implements IJarChangeLi
public void unloadBundles() {
bundleCoordinator.uninstallBundles();
}
+
+ @Override
+ public boolean preShutdown(IWorkbench workbench, boolean forced) {
+ unloadBundles();
+ return true;
+ }
+
+ @Override
+ public void postShutdown(IWorkbench workbench) {
+ }
}

Back to the top