当前位置: 首页>>代码示例>>Java>>正文


Java IApplicationContext.getArguments方法代码示例

本文整理汇总了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;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:21,代码来源:Application.java

示例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.
}
 
开发者ID:eclipse,项目名称:dawnsci,代码行数:28,代码来源:DataServer.java

示例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;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:ReportDebugger.java

示例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;
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:33,代码来源:Application.java

示例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;
}
 
开发者ID:google,项目名称:depan,代码行数:14,代码来源:Application.java

示例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;

}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:34,代码来源:RunHeadlessMode.java

示例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;
}
 
开发者ID:markus1978,项目名称:srcrepo,代码行数:49,代码来源:EmfFragSrcRepoImport.java

示例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;
}
 
开发者ID:markus1978,项目名称:srcrepo,代码行数:53,代码来源:EmfFragSrcRepoDirectoryImport.java


注:本文中的org.eclipse.equinox.app.IApplicationContext.getArguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。