コード例 #1
0
ファイル: MainAction.java プロジェクト: vitorchaud/ReMoto
  public void createSimulation(HttpServletRequest req, Configuration conf) {
    cleanSimulation(req);

    String cdSimulation = getCdSimulation(req, conf.getId());

    Simulation sim;

    // Create a new simulation if configurations have been changed
    if (conf.isChangedConfiguration() == true && conf.isKeepProperties() == false) {
      sim = new Simulation(conf, cdSimulation);
    } else {
      sim = (Simulation) ReMoto.simulations.get(cdSimulation);

      if (sim == null) sim = new Simulation(conf, cdSimulation);
    }

    new Thread(sim).start();
  }
コード例 #2
0
ファイル: MainAction.java プロジェクト: vitorchaud/ReMoto
  public boolean saveUserConfiguration(HttpServletRequest req, Configuration conf, User user) {
    if (conf == null || user == null) {
      return false;
    }

    req.getSession().setAttribute("idSimulation", Integer.toString(conf.getId()));

    // Save configuration properties
    ConfigurationDAO simDAO = new ConfigurationDAO();

    return simDAO.saveConfiguration(conf, user);
  }