コード例 #1
0
  /**
   * Transforms the Collection of runners into a Vector of runners parameters.
   *
   * @param runners
   * @return the Collection of runners into a Vector of runners parameters
   */
  public static Vector<Object> toXmlRpcRunnersParameters(Collection<Runner> runners) {
    Vector<Object> runnersParams = new Vector<Object>();
    for (Runner runner : runners) {
      runnersParams.add(runner.marshallize());
    }

    return runnersParams;
  }
コード例 #2
0
  /**
   * Transforms the Vector of the Runner parameters into a Runner Object.<br>
   *
   * @param xmlRpcParameters
   *     Runner['name','cmd',['envtypename'],'servername','serverport','mainclass',['cp1','cp2'],'secured']
   * @return the Runner.
   */
  @SuppressWarnings("unchecked")
  public static Runner toRunner(Vector<Object> xmlRpcParameters) {
    Runner runner = null;
    if (!xmlRpcParameters.isEmpty()) {
      runner = Runner.newInstance((String) getParameter(RUNNER_NAME_IDX, xmlRpcParameters));
      runner.setCmdLineTemplate(
          toNullIfEmpty((String) getParameter(RUNNER_CMDLINE_IDX, xmlRpcParameters)));
      runner.setEnvironmentType(
          toEnvironmentType((Vector) getParameter(RUNNER_ENVTYPE_IDX, xmlRpcParameters)));
      runner.setServerName(
          toNullIfEmpty((String) getParameter(RUNNER_SERVER_NAME_IDX, xmlRpcParameters)));
      runner.setServerPort(
          toNullIfEmpty((String) getParameter(RUNNER_SERVER_PORT_IDX, xmlRpcParameters)));
      runner.setMainClass(
          toNullIfEmpty((String) getParameter(RUNNER_MAINCLASS_IDX, xmlRpcParameters)));
      ClasspathSet classpaths =
          new ClasspathSet((Vector) getParameter(RUNNER_CLASSPATH_IDX, xmlRpcParameters));
      runner.setClasspaths(classpaths);
      runner.setSecured((Boolean) getParameter(RUNNER_SECURED_IDX, xmlRpcParameters));
    }

    return runner;
  }