Save parameters that permit to relaunch a VM with
{@link #relaunchVM()}.

@param classToLaunch is the class which contains a <code>main</code>.
@param parameters is the parameters to pass to the <code>main</code>.
@since 6.2
512460
public static void saveVMParameters(String classToLaunch, String... parameters) {
		classnameToLaunch = classToLaunch;
		commandLineParameters = parameters;
		if (commandLineOptions != null) {
			commandLineOptions.clear();
		}
		commandLineOptions = null;
		analyzed = false;
	}
992233
public static void main(String[] args) {
    ProcessEntryPoint entryPoint = ProcessEntryPoint.createForArguments(args);
    Props props = entryPoint.getProps();
    new WebServerProcessLogging().configure(props);
    WebServer server = new WebServer(props);
    entryPoint.launch(server);
  }
111042
@Inline(value = "VMCommandLine.saveVMParameters((($1) != null) ? ($1).getCanonicalName() : null, ($2))",
			imported = {VMCommandLine.class}, statementExpression = true)
	public static void saveVMParameters(Class<?> classToLaunch, String... parameters) {
 		saveVMParameters(
 				(classToLaunch != null)
 				? classToLaunch.getCanonicalName()
 				: null, parameters);
	}
1208655
public static void main(String[] args) {
    Properties properties = new Properties();
    LOG.info("Load chronos.cfg configuration from class path");
    try {
      properties.load(ChronosServer.class.getClassLoader().getResourceAsStream("chronos.cfg"));
      properties.setProperty(FailoverServer.BASE_ZNODE,
        "/chronos" + "/" + properties.getProperty(CLUSTER_NAME));
    } catch (IOException e) {
      LOG.fatal("Error to load chronos.cfg configuration, exit immediately", e);
      System.exit(0);
    }

    ChronosServer chronosServer = null;
    LOG.info("Init chronos server and connect ZooKeeper");
    try {
      chronosServer = new ChronosServer(properties);
    } catch (Exception e) {
      LOG.fatal("Exception to init chronos server, exit immediately", e);
      System.exit(0);
    }
    chronosServer.run();
  }
605959
private void loadParameters(String[] args)
    {
        for (int i = 0; (i < args.length) && args[i].startsWith("-"); i++)
        {
            String parameterName = args[i];
            if (parameterName.equalsIgnoreCase("-key"))
                privateKeyFile = new File(args[++i]);
            else if (parameterName.equalsIgnoreCase("-cert"))
                certFile = new File(args[++i]);
        else if (parameterName.equalsIgnoreCase("-keystore"))
                keyStoreFile = new File(args[++i]);
            else if (parameterName.equalsIgnoreCase("-storetype"))
                keyStoreType = args[++i];
            else if (parameterName.equalsIgnoreCase("-alias"))
                alias = args[++i];
            else if (parameterName.equalsIgnoreCase("-provider"))
                providerClassName = args[++i];
            else
            {
                System.err.println("Illegal parameter: " + parameterName);
                usage();
            }
        }

        // Check that mandatory fields have been populated
        if (privateKeyFile == null || certFile == null)
        {
            usage();
        }

        keyStorePassword = Password.getPassword("jetty.ssl.password",null,null);
        keyPassword = Password.getPassword("jetty.ssl.keypassword",
                                           null,
                                           keyStorePassword.toString());
    }
237714
public synchronized Launch newLaunch(final Class<?> jobClass, ExecutorService executorService) throws LaunchException {
		return new Launch(jobClass, executorService);
	}
243225
public void addInitParam(final WebAppInitParam param) {
		NullArgumentException.validateNotNull(param, "Init param");
		NullArgumentException.validateNotNull(param.getParamName(),
				"Init param name");
		NullArgumentException.validateNotNull(param.getParamValue(),
				"Init param value");
		initParams.add(param);
	}
179593
private void initMainParameterValue(String arg) {
        if (mainParameter == null) {
            throw new ParameterException(
                    "Was passed main parameter '" + arg + "' but no main parameter was defined in your arg class");
        }

        Object object = mainParameter.parameterized.get(mainParameter.object);
        Class<?> type = mainParameter.parameterized.getType();

        // If it's a List<String>, we might need to create that list and then add the value to it.
        if (List.class.isAssignableFrom(type)) {
            List result;
            if (object == null) {
                result = Lists.newArrayList();
            } else {
                result = (List) object;
            }

            if (mainParameter.firstTimeMainParameter) {
                result.clear();
                mainParameter.firstTimeMainParameter = false;
            }

            mainParameter.multipleValue = result;
            mainParameter.parameterized.set(mainParameter.object, result);
        }

    }
297860
@NotNull
    protected Map<String, Object> toParameterTypes(ParameterElement... parameters) {
        final LinkedHashMap<String, Object> map = new LinkedHashMap<>(parameters.length);
        for (ParameterElement ce : parameters) {
            final ClassElement type = ce.getType();
            if (type == null) {
                continue;
            }
            final Type typeReference = getTypeForElement(type);
            map.put(ce.getName(), typeReference);
        }

        return map;
    }
1228643
public <T> Launch<T> newLaunch(Class<? extends T> programClass)
			throws LaunchException {
		return newLaunch(programClass, null);
	}
1200848
private List<String> initializeLaunch(ILaunch launch,
			ILaunchConfiguration configuration, String mode,
			IProgressMonitor monitor) throws CoreException
	{
		List<String> commandList = null;

		Integer debugSessionId = Integer.valueOf(getSessionId());
		if (useRemoteDebug(configuration))
		{
			debugSessionId = 1;
		}

		commandList = new ArrayList<String>();

		IVdmProject vdmProject = getVdmProject(configuration);

		Assert.isNotNull(vdmProject, " Project not found: "
				+ configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_PROJECT, ""));

		if (vdmProject == null
				|| !VdmTypeCheckerUi.typeCheck(vdmProject, monitor))
		{
			abort("Cannot launch a project (" + vdmProject
					+ ") with type errors, please check the problems view", null);
		}

		String charSet = getProject(configuration).getDefaultCharset();

		commandList.add("-h");
		commandList.add("localhost");
		commandList.add("-p");
		int port = VdmDebugPlugin.getDefault().getDbgpService().getPort();

		// Hook for external tools to direct the debugger to listen on a specific port
		int overridePort = configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_OVERRIDE_PORT, IDebugPreferenceConstants.DBGP_AVAILABLE_PORT);
		if (overridePort != IDebugPreferenceConstants.DBGP_AVAILABLE_PORT)
		{
			port = VdmDebugPlugin.getDefault().getDbgpService(overridePort).getPort();
		}

		commandList.add(Integer.valueOf(port).toString());

		commandList.add("-k");
		commandList.add(debugSessionId.toString());
		commandList.add("-w");
		commandList.add("-q");
		commandList.add(vdmProject.getDialect().getArgstring());
		commandList.add("-r");
		commandList.add(vdmProject.getLanguageVersionName());
		// set disable interpreter settings
		if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_PRE_CHECKS, true))// vdmProject.hasPrechecks())
		{
			commandList.add("-pre");
		}
		if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_POST_CHECKS, true))// vdmProject.hasPostchecks())
		{
			commandList.add("-post");
		}
		if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_INV_CHECKS, true))// vdmProject.hasInvchecks())
		{
			commandList.add("-inv");
		}
		if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_DTC_CHECKS, true))// vdmProject.hasDynamictypechecks())
		{
			commandList.add("-dtc");
		}
		if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_MEASURE_CHECKS, true))// vdmProject.hasMeasurechecks())
		{
			commandList.add("-measures");
		}

		commandList.add("-c");
		commandList.add(charSet);
		if (!isRemoteControllerEnabled(configuration))
		{
			commandList.add("-e64");
			commandList.add(getExpressionBase64(configuration, charSet));
			String default64 = getDefaultBase64(configuration, charSet);
			if (default64.trim().length() > 0)
			{
				commandList.add("-default64");
				commandList.add(getDefaultBase64(configuration, charSet));
			}
		} else
		{
			// temp fix for commanline args of dbgreader
			commandList.add("-e64");
			commandList.add(Base64.encode("A".getBytes()).toString());
		}

		if (isRemoteControllerEnabled(configuration))
		{
			commandList.add("-remote");
			commandList.add(getRemoteControllerName(configuration));
		}

		if (hasTrace(configuration))
		{
			commandList.add("-t");
		}

		commandList.add("-consoleName");
		commandList.add("LaunchConfigurationExpression");

		commandList.addAll(getExtendedCommands(vdmProject, configuration));

		commandList.add("-baseDir");
		commandList.add(getProject(configuration).getLocationURI().toASCIIString());

		commandList.addAll(getSpecFiles(vdmProject));
		if (useRemoteDebug(configuration))
		{
			System.out.println("Debugger Arguments:\n"
					+ getArgumentString(commandList));
		}
		commandList.add(0, "java");
		commandList.add(1, IDebugConstants.DEBUG_ENGINE_CLASS);

		if (configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_SHOW_VM_SETTINGS, false))
		{
			commandList.addAll(1, Arrays.asList(new String[] { "-XshowSettings:all" }));
		}
		
		commandList.addAll(1, getVmArguments(configuration));

		if (useRemoteDebug(configuration))
		{
			System.out.println("Full Debugger Arguments:\n"
					+ getArgumentString(commandList));
		}

		VdmDebugTarget target = null;
		// Debug mode
		if (mode.equals(ILaunchManager.DEBUG_MODE))
		{
			IDbgpService service = VdmDebugPlugin.getDefault().getDbgpService();

			if (!service.available())
			{
				abort("Could not create DBGP Service", null);
			}

			DebugPlugin.getDefault().getBreakpointManager().setEnabled(true);

			target = new VdmDebugTarget(IDebugConstants.ID_VDM_DEBUG_MODEL, service, debugSessionId.toString(), launch, null);
			target.setVdmProject(vdmProject);
			launch.addDebugTarget(target);
			target.toggleClassVariables(true);
			target.toggleGlobalVariables(true);
			target.toggleLocalVariables(true);

		}
		// Run mode
		else if (mode.equals(ILaunchManager.RUN_MODE))
		{
			IDbgpService service = VdmDebugPlugin.getDefault().getDbgpService();

			if (!service.available())
			{
				abort("Could not create DBGP Service", null);
			}

			DebugPlugin.getDefault().getBreakpointManager().setEnabled(false);

			target = new VdmDebugTarget(IDebugConstants.ID_VDM_DEBUG_MODEL, service, debugSessionId.toString(), launch, null);
			target.setVdmProject(vdmProject);
			launch.addDebugTarget(target);

			target.toggleClassVariables(true);
			target.toggleGlobalVariables(true);
			target.toggleLocalVariables(true);

		}
		return commandList;
	}
1163591
@Override
	public String createMachine( TargetHandlerParameters parameters ) throws TargetException {

		this.logger.fine( "Creating a new VM @ OCCI." );

		// For IaaS, we only expect root instance names to be passed
		if( InstanceHelpers.countInstances( parameters.getScopedInstancePath()) > 1 )
			throw new TargetException( "Only root instances can be passed in arguments." );

		// Deal with the creation
		try {
			UUID id = UUID.randomUUID();
			Map<String, String> targetProperties = parameters.getTargetProperties();

			String userData = UserDataHelpers.writeUserDataAsString(
					parameters.getMessagingProperties(),
					parameters.getDomain(),
					parameters.getApplicationName(),
					parameters.getScopedInstancePath());

			if("json".equalsIgnoreCase(targetProperties.get(RENDERING))) {
				return OcciVMUtils.createVMJson(targetProperties.get(SERVER_IP_PORT),
					id.toString(),
					targetProperties.get(IMAGE),
					targetProperties.get(TITLE),
					targetProperties.get(SUMMARY),
					userData,
					targetProperties.get(USER),
					targetProperties.get(PASSWORD),
					targetProperties,
					false);
			} else {
				return OcciVMUtils.createVM(targetProperties.get(SERVER_IP_PORT),
						id.toString(),
						targetProperties.get(IMAGE),
						targetProperties.get(TITLE),
						targetProperties.get(SUMMARY),
						userData,
						targetProperties.get(USER),
						targetProperties.get(PASSWORD),
						targetProperties);
			}
		} catch( Exception e ) {
			throw new TargetException(e);
		}
	}
1207739
private void initParams() {

        Object o;

        if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
            // read params from config
            o = null;
        } else {
            // this is not the initial call, get params from session
            o = getDialogObject();
        }
        if (!(o instanceof CmsSearchWorkplaceBean)) {
            String oldExplorerMode = getSettings().getExplorerMode();
            getSettings().setExplorerMode(null);
            String explorerResource = getSettings().getExplorerResource();
            getSettings().setExplorerMode(oldExplorerMode);
            m_search = new CmsSearchWorkplaceBean(explorerResource);
        } else {
            // reuse params stored in session
            m_search = (CmsSearchWorkplaceBean)o;
        }
    }
98459
public Partition withParameters(java.util.Map<String, String> parameters) {
        setParameters(parameters);
        return this;
    }
1037375
private LaunchArguments createLaunchArguments(String[] args, Map<String, String> initProps) {
        List<String> cmdArgs = processBatchFileArgs(new ArrayList<String>(Arrays.asList(args)));
        return new LaunchArguments(cmdArgs, initProps, isClient());
    }
866489
@SuppressWarnings("unchecked")
	private Map<String, Object> buildParameters(Object parameters) {
		Map<String, Object> parameterMap = new HashMap<String, Object>();

		if (parameters != null) {
			if (parameters.getClass().isArray()) {
				Object[] paramValues = (Object[]) parameters;
				for (int i = 0; i < paramValues.length; i++) {
					if (paramValues[i] == null) {
						paramValues[i] = "";
					}
					parameterMap.put(Integer.toString(i), paramValues[i]);
				}
			} else if (parameters instanceof Map) {
				parameterMap = (Map<String, Object>) parameters;
			} else {
				Class<? extends Object> paramClass = parameters.getClass();
				Field[] fields = paramClass.getDeclaredFields();
				for (Field field : fields) {
					field.setAccessible(true);

					String fieldName = field.getName();
					Object fieldValue = null;
					try {
						fieldValue = field.get(parameters);
					} catch (Exception e) {
						fieldValue = null;
					}
					if (fieldName != null && fieldValue != null) {
						parameterMap.put(fieldName, fieldValue);
					}
				}
			}
		}

		return parameterMap;
	}
865067
@Override
    public void addParameterAnnotation(int param, AnnotationValue annotationValue) {
        HashMap<Integer, Map<ClassDescriptor, AnnotationValue>> updatedAnnotations = new HashMap<>(
                methodParameterAnnotations);
        Map<ClassDescriptor, AnnotationValue> paramMap = updatedAnnotations.get(param);
        if (paramMap == null) {
            paramMap = new HashMap<>();
            updatedAnnotations.put(param, paramMap);
        }
        paramMap.put(annotationValue.getAnnotationClass(), annotationValue);

        methodParameterAnnotations = updatedAnnotations;
        TypeQualifierApplications.updateAnnotations(this);
    }