コード例 #1
0
  public void loadSerializedData() {
    // fixme        Race x = loadXML();
    // return;
    // lastRace.getName();
    //        RaceRun run;
    try {
      //          lastRace.loadSerializedData();
      String fileName = lastRace.getName();
      FileInputStream fileIn = new FileInputStream(fileName + ".ser"); // "RaceRun.ser");
      try {
        ObjectInputStream in = new ObjectInputStream(fileIn);
        deSerialize(in);

        in.close();
        fileIn.close();

        tagHeuerConnected = new Boolean(false); // / make sure it exists - transient object
        microgateConnected = new Boolean(false); // / make sure it exists - transient object

      } catch (InvalidClassException ice) {
        log.info("Invalid Class from deserialization " + ice.classname);
      } catch (EOFException eof) {
        log.info("EOF on Serialized data");
      } catch (IOException i) {
        i.printStackTrace();
        // } catch (ClassNotFoundException cnf) {
        //    cnf.printStackTrace();
      } catch (Exception e) {
        e.printStackTrace();
      }
    } catch (FileNotFoundException fnf) {
      // Empty block OK - ignore this exception
    }

    // load required transient members
    Log raceRunLog = Log.getInstance();
    for (RaceRun r : activeRuns) {
      r.setLog(raceRunLog);
    }
    for (RaceRun r : completedRuns) {
      r.setLog(raceRunLog);
    }
    if (pendingRerun != null) {
      pendingRerun.setLog(raceRunLog);
    }

    //     updateResults();   //todo OK Here ???        NO - didn't set

  }