Issue #1522 - disable Spring during installs and uninstalls
Former-commit-id:b4945796a3
[formerlyab7f75ad73
] [formerly09735415c5
] [formerly117028c632
[formerly09735415c5
[formerly 293dd0c762884f285e455d94708b6e9fcc82023f]]] Former-commit-id:117028c632
Former-commit-id: 042aa3503e2052385e138273b071ed7d19fad917 [formerlya90266a49f
] Former-commit-id:473368e0c8
This commit is contained in:
parent
7b1dbd3c56
commit
7214b65ccf
1 changed files with 150 additions and 118 deletions
|
@ -16,6 +16,7 @@ import org.osgi.framework.Bundle;
|
|||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.Constants;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -30,6 +31,8 @@ import org.osgi.framework.Constants;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 12, 2010 mschenke Initial creation
|
||||
* Jan 24, 2013 1522 bkowal Halt initialization if a p2 installation
|
||||
* has been started
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -62,6 +65,9 @@ public class Activator implements BundleActivator {
|
|||
* org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
if (this.isInstallOperation()) {
|
||||
return;
|
||||
}
|
||||
plugin = this;
|
||||
|
||||
Map<String, OSGIXmlApplicationContext> contextMap = new HashMap<String, OSGIXmlApplicationContext>();
|
||||
|
@ -167,4 +173,30 @@ public class Activator implements BundleActivator {
|
|||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Based on the command line arguments, determine whether or not an Eclipse
|
||||
* p2 repository will be installed
|
||||
*
|
||||
* @return true if an Eclipse p2 repository is going to be installed, false
|
||||
* otherwise
|
||||
*/
|
||||
private boolean isInstallOperation() {
|
||||
final String P2_DIRECTOR = "org.eclipse.equinox.p2.director";
|
||||
|
||||
/**
|
||||
* We look at the command line arguments instead of the program
|
||||
* arguments (com.raytheon.uf.viz.application.ProgramArguments) because
|
||||
* the command line arguments include almost everything that was passed
|
||||
* as an argument to the Eclipse executable instead of just what CAVE is
|
||||
* interested in.
|
||||
*/
|
||||
for (String argument : Platform.getCommandLineArgs()) {
|
||||
if (P2_DIRECTOR.equals(argument)) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue