コード例 #1
0
ファイル: CTCompositeActor.java プロジェクト: blickly/ptii
  /** Record the current state of all the actors in this composite actor. */
  public void markState() {
    Set<Checkpoint> checkpoints = new HashSet<Checkpoint>();
    Iterator objectsIter = containedObjectsIterator();

    while (objectsIter.hasNext()) {
      Object object = objectsIter.next();

      if (object instanceof Rollbackable) {
        Rollbackable rollbackObject = (Rollbackable) object;
        Checkpoint checkpoint = rollbackObject.$GET$CHECKPOINT();

        if (!checkpoints.contains(checkpoint)) {
          // FIXME: older states should be discarded.
          checkpoint.createCheckpoint();
          checkpoints.add(checkpoint);
        }
      }
    }
  }