本文整理匯總了Java中org.eclipse.equinox.app.IApplicationContext.getArguments方法的典型用法代碼示例。如果您正苦於以下問題:Java IApplicationContext.getArguments方法的具體用法?Java IApplicationContext.getArguments怎麽用?Java IApplicationContext.getArguments使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.equinox.app.IApplicationContext
的用法示例。
在下文中一共展示了IApplicationContext.getArguments方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: start
import org.eclipse.equinox.app.IApplicationContext; //導入方法依賴的package包/類
@Override
public Object start(final IApplicationContext context) throws Exception {
// SystemLogger.removeDisplay();
final Map<String, String[]> mm = context.getArguments();
final List<String> args = Arrays.asList(mm.get("application.args"));
if (args.contains(HELP_PARAMETER)) {
System.out.println(showHelp());
} else if (args.contains(VALIDATE_LIBRARY_PARAMETER)) {
return ModelLibraryValidator.getInstance().start(args);
} else if (args.contains(TEST_LIBRARY_PARAMETER)) {
return ModelLibraryTester.getInstance().start(args);
} else if (args.contains(CHECK_MODEL_PARAMETER)) {
ModelLibraryGenerator.start(this, args);
} else if (args.contains(BUILD_XML_PARAMETER)) {
buildXML(args);
} else {
runSimulation(args);
}
return null;
}
示例2: start
import org.eclipse.equinox.app.IApplicationContext; //導入方法依賴的package包/類
/**
* Method replaces main(...) when running things with OSGi
*
* Not called on GDA server will will probably start the Data Server by calling 'start' from spring, no arguments.
*/
@Override
public Object start(IApplicationContext context) throws Exception {
@SuppressWarnings("rawtypes")
final Map args = context.getArguments();
final String[] configuration = (String[])args.get("application.args");
Map<String, String> conf = new HashMap<String, String>(7);
for (int i = 0; i < configuration.length; i++) {
final String pkey = configuration[i];
if (pkey.startsWith("-")) {
conf.put(pkey.substring(1), configuration[i+1]);
}
}
if (conf.containsKey("port")) {
setPort(Integer.parseInt(conf.get("port").toString()));
}
start(true); // blocking
return server;// We are done with this application now.
}
示例3: start
import org.eclipse.equinox.app.IApplicationContext; //導入方法依賴的package包/類
public Object start( IApplicationContext context ) throws Exception
{
String[] appArgs = new String[0];
if ( context.getArguments( ) != null )
{
Object args = context.getArguments( )
.get( IApplicationContext.APPLICATION_ARGS );
if ( args instanceof String[] )
{
appArgs = (String[]) args;
}
}
ReportLauncher.main( appArgs );
return null;
}
示例4: start
import org.eclipse.equinox.app.IApplicationContext; //導入方法依賴的package包/類
@Override
public Object start(IApplicationContext context) throws Exception {
this.latch = new CountDownLatch(1);
final Map<?, ?> args = context.getArguments();
final String[] configuration = (String[])args.get("application.args");
Map<String, String> conf = new HashMap<String, String>(7);
for (int i = 0; i < configuration.length; i++) {
final String pkey = configuration[i];
if (pkey.startsWith("-")) {
if (i<configuration.length-1) {
conf.put(pkey.substring(1), configuration[i+1]);
} else {
conf.put(pkey.substring(1), null);
}
}
}
if (conf.containsKey("startActiveMQ")) {
IMessagingService mservice = Services.getMessagingService();
String uri = System.getProperty("org.eclipse.scanning.broker.uri");
mservice.start(uri);
}
PseudoSpringParser parser = new PseudoSpringParser();
this.objects = parser.parse(conf.get("xml"));
latch.await();
return objects;
}
示例5: start
import org.eclipse.equinox.app.IApplicationContext; //導入方法依賴的package包/類
@Override
public Object start(IApplicationContext context) throws Exception {
final Map<?, ?> args = context.getArguments();
final String[] appArgs = (String[]) args.get("application.args");
CommandDispatch cli = new CommandDispatch();
cli.dispatch(Arrays.asList(appArgs));
Object result = cli.getResult();
if (IApplication.EXIT_OK != result) {
CmdLogger.LOG.error("Depan Cmd failure with result: {}", result);
}
return result;
}
示例6: start
import org.eclipse.equinox.app.IApplicationContext; //導入方法依賴的package包/類
@Override
public Object start(IApplicationContext arg0) throws Exception {
@SuppressWarnings("unchecked")
Map<String, Object> contextArguments = arg0.getArguments();
String [] cmdArgs = (String[]) contextArguments.get(IApplicationContext.APPLICATION_ARGS);
CheckUpdatesManager checkUpdatesManager = new CheckUpdatesManager();
if (cmdArgs.length == 2) {
System.out.println("Arguments Received : ------------------------------------------\n");
System.out.println("\n URL of the Repository tested : " + cmdArgs[0] + "\n Feature Being Checked :" + cmdArgs[1]);
System.out.println("\n \n Arguments Computed : ------------------------------------------\n");
System.out.println(cmdArgs[0] + " and " + cmdArgs[1]);
if (cmdArgs[1] == null || cmdArgs[0] == null) {
System.out.println(
"\n \n Invalid Arguments, arguments passed should be P2 repository URL and updated feature ID \n");
System.exit(1);
}
checkUpdatesManager.checkForAvailableUpdates(generateNewProgressMonitor(), cmdArgs[0], cmdArgs[1]);
} else if (cmdArgs.length > 2) {
List<String> comdArgArray = new ArrayList<String>(Arrays.asList(cmdArgs));
comdArgArray.remove(0);
String[] array = comdArgArray.toArray(new String[comdArgArray.size()]);
checkUpdatesManager.checkForAvailableUpdates(generateNewProgressMonitor(), cmdArgs[0], array);
System.out.println("Arguments Received : ------------------------------------------\n");
System.out.println(
"\n \n Received Arguments, with multiple feature IDs \n");
} else {
System.out.println(
"\n \n Invalid Arguments, arguments passed should be P2 repository URL and updated feature ID \n");
System.exit(1);
}
return cmdArgs;
}
示例7: start
import org.eclipse.equinox.app.IApplicationContext; //導入方法依賴的package包/類
@Override
public Object start(IApplicationContext context) throws Exception {
// ensure loading of plug-ins
EmfFragActivator.class.getName();
SrcRepoActivator.class.getName();
EmfFragMongoDBActivator.class.getName();
// checking command line options
final Map<?,?> args = context.getArguments();
final String[] appArgs = (String[]) args.get("application.args");
CommandLineParser cliParser = new DefaultParser();
Options options = createOptions();
CommandLine commandLine = null;
try {
commandLine = cliParser.parse(options, appArgs);
} catch (Exception e) {
printUsage();
return IApplication.EXIT_OK;
}
if (!checkArgs(commandLine)) {
printUsage();
return IApplication.EXIT_OK;
}
URI modelURI = URI.createURI((String)commandLine.getArgList().get(1));
File workingDirectory = new File((String)commandLine.getArgList().get(0));
Configuration config = new Configuration(new GitSourceControlSystem(), workingDirectory, modelURI);
if (commandLine.hasOption("clone")) {
config.repositoryURL(commandLine.getOptionValue("clone"));
}
if (commandLine.hasOption("fragments-cache")) {
config.fragmentCacheSize(Integer.parseInt(commandLine.getOptionValue("fragments-cache")));
}
if (commandLine.hasOption("checkout-without-import")) {
config.checkOutWithoutImport();
}
if (commandLine.hasOption("use-flat-traversal")) {
config.useFlatTraversal();
}
if (commandLine.hasOption("use-c-git")) {
config.useCGit();
}
importRepository(config);
return IApplication.EXIT_OK;
}
示例8: start
import org.eclipse.equinox.app.IApplicationContext; //導入方法依賴的package包/類
@Override
public Object start(IApplicationContext context) throws Exception {
// ensure loading of plug-ins
EmfFragActivator.class.getName();
SrcRepoActivator.class.getName();
EmfFragMongoDBActivator.class.getName();
// checking command line options
final Map<?,?> args = context.getArguments();
final String[] appArgs = (String[]) args.get("application.args");
CommandLineParser cliParser = new DefaultParser();
Options options = createOptions();
CommandLine commandLine = null;
try {
commandLine = cliParser.parse(options, appArgs);
} catch (Exception e) {
printUsage();
return IApplication.EXIT_OK;
}
if (!checkArgs(commandLine)) {
printUsage();
return IApplication.EXIT_OK;
}
Configuration config = new GitConfiguration();
if (commandLine.hasOption("directory-uri")) {
config.directoryModelURI(URI.createURI(commandLine.getOptionValue("directory-uri")));
}
if (commandLine.hasOption("locks")) {
config.locks(new File(commandLine.getOptionValue("locks")));
}
if (commandLine.hasOption("workingcopies")) {
config.workingcopies(new File(commandLine.getOptionValue("workingcopies")));
}
if (commandLine.hasOption("repository")) {
config.repositoryName(commandLine.getOptionValue("repository"));
}
if (commandLine.hasOption("fragments-cache")) {
config.fragmentCacheSize(Integer.parseInt(commandLine.getOptionValue("fragments-cache")));
}
if (commandLine.hasOption("checkout-without-import")) {
config.checkOutWithoutImport();
}
if (commandLine.hasOption("use-c-git")) {
config.useCGit();
}
importRepository(config);
return IApplication.EXIT_OK;
}