diff options
Diffstat (limited to 'org.genivi.commonapi.core.cli/src/org/genivi/commonapi/core/cli/Application.java')
-rw-r--r-- | org.genivi.commonapi.core.cli/src/org/genivi/commonapi/core/cli/Application.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/org.genivi.commonapi.core.cli/src/org/genivi/commonapi/core/cli/Application.java b/org.genivi.commonapi.core.cli/src/org/genivi/commonapi/core/cli/Application.java new file mode 100644 index 0000000..2a45fd4 --- /dev/null +++ b/org.genivi.commonapi.core.cli/src/org/genivi/commonapi/core/cli/Application.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2013 BMW Group Author: Manfred Bathelt (manfred.bathelt@bmw.de) + * Author: Juergen Gehring (juergen.gehring@bmw.de) This Source Code Form is + * subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the + * MPL was not distributed with this file, You can obtain one at + * http://mozilla.org/MPL/2.0/. + */ +package org.genivi.commonapi.core.cli; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.equinox.app.IApplication; +import org.eclipse.equinox.app.IApplicationContext; + +public class Application implements IApplication +{ + /* + * (non-Javadoc) + * + * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app. + * IApplicationContext) + */ + @Override + public Object start(IApplicationContext context) throws Exception + { + /* + * sleep 100 ms to guarantee that the gogo.shell.Activator is not + * interrupted in start-up, sometimes causing a InterruptException + */ + Thread.sleep(100); + String[] args = Platform.getApplicationArgs(); + + try + { + CommandlineToolMain.generate(args); + } + catch (IllegalArgumentException e) + { + System.err.println(e.getMessage()); + } + + return IApplication.EXIT_OK; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.equinox.app.IApplication#stop() + */ + @Override + public void stop() + { + + } +} |