Bug 284357 Code in ReflectionContributionFactory duplicates #invoke() - with a twist
bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
String value = getArgValue(E4Workbench.SAVE_AND_RESTORE, appContext);
		saveAndRestore = value == null || Boolean.getBoolean(value);
		eclipseContext.set(E4Workbench.SAVE_AND_RESTORE,
				Boolean.valueOf(saveAndRestore));
		eclipseContext.set(E4Workbench.INITIAL_WORKBENCH_MODEL_URI,
				initialWorkbenchDefinitionInstance);
		eclipseContext.set(E4Workbench.INSTANCE_LOCATION, instanceLocation);
		String resourceHandler = getArgValue(
				E4Workbench.MODEL_RESOURCE_HANDLER, appContext);
		if (resourceHandler == null) {
			resourceHandler = "platform:/plugin/org.eclipse.e4.ui.workbench/"
					+ ResourceHandler.class.getName();
		}
		IContributionFactory factory = eclipseContext
				.get(IContributionFactory.class);
		handler = (IModelResourceHandler) factory.create(resourceHandler,
				eclipseContext);
		Resource resource = handler.loadMostRecentModel();
		theApp = (MApplication) resource.getContents().get(0);
		return theApp;
	}
	private String getArgValue(String argName, IApplicationContext appContext) {
		
		if (argName == null || argName.length() == 0)
			return null;
		for (int i = 0; i < args.length; i += 2) {
			if (argName.equals(args[i]))
				return args[i + 1];
		}
		return appContext.getBrandingProperty(argName);