Package ptolemy.backtrack

Examples of ptolemy.backtrack.Checkpoint


                            return $CHECKPOINT;
                        }

                        public final Object $SET$CHECKPOINT_ANONYMOUS(Checkpoint checkpoint) {
                            if ($CHECKPOINT != checkpoint) {
                                Checkpoint oldCheckpoint = $CHECKPOINT;
                                if (checkpoint != null) {
                                    $RECORD$$CHECKPOINT.add($CHECKPOINT, checkpoint.getTimestamp());
                                    FieldRecord.pushState($RECORDS);
                                }
                                $CHECKPOINT = checkpoint;
                                oldCheckpoint.setCheckpoint(checkpoint);
                                checkpoint.addObject(new _PROXY_());
                            }
                            return this;
                        }

                        private transient FieldRecord $RECORD$map_iterator = new FieldRecord(0);

                        private transient FieldRecord[] $RECORDS = new FieldRecord[] {
                                $RECORD$map_iterator
                            };

                        {
                            $CHECKPOINT.addObject(new _PROXY_());
                        }

                    };
                }

                final class _PROXY_ implements Rollbackable {

                    public final void $COMMIT(long timestamp) {
                        $COMMIT_ANONYMOUS(timestamp);
                    }

                    public final void $RESTORE(long timestamp, boolean trim) {
                        $RESTORE_ANONYMOUS(timestamp, trim);
                    }

                    public final Checkpoint $GET$CHECKPOINT() {
                        return $GET$CHECKPOINT_ANONYMOUS();
                    }

                    public final Object $SET$CHECKPOINT(Checkpoint checkpoint) {
                        $SET$CHECKPOINT_ANONYMOUS(checkpoint);
                        return this;
                    }

                }

                public void $COMMIT_ANONYMOUS(long timestamp) {
                    FieldRecord.commit($RECORDS, timestamp, $RECORD$$CHECKPOINT.getTopTimestamp());
                    super.$COMMIT(timestamp);
                }

                public void $RESTORE_ANONYMOUS(long timestamp, boolean trim) {
                    super.$RESTORE(timestamp, trim);
                }

                public final Checkpoint $GET$CHECKPOINT_ANONYMOUS() {
                    return $CHECKPOINT;
                }

                public final Object $SET$CHECKPOINT_ANONYMOUS(Checkpoint checkpoint) {
                    if ($CHECKPOINT != checkpoint) {
                        Checkpoint oldCheckpoint = $CHECKPOINT;
                        if (checkpoint != null) {
                            $RECORD$$CHECKPOINT.add($CHECKPOINT, checkpoint.getTimestamp());
                            FieldRecord.pushState($RECORDS);
                        }
                        $CHECKPOINT = checkpoint;
                        oldCheckpoint.setCheckpoint(checkpoint);
                        checkpoint.addObject(new _PROXY_());
                    }
                    return this;
                }
View Full Code Here


                            return $CHECKPOINT;
                        }

                        public final Object $SET$CHECKPOINT_ANONYMOUS(Checkpoint checkpoint) {
                            if ($CHECKPOINT != checkpoint) {
                                Checkpoint oldCheckpoint = $CHECKPOINT;
                                if (checkpoint != null) {
                                    $RECORD$$CHECKPOINT.add($CHECKPOINT, checkpoint.getTimestamp());
                                    FieldRecord.pushState($RECORDS);
                                }
                                $CHECKPOINT = checkpoint;
                                oldCheckpoint.setCheckpoint(checkpoint);
                                checkpoint.addObject(new _PROXY_());
                            }
                            return this;
                        }

                        private transient FieldRecord $RECORD$map_iterator = new FieldRecord(0);

                        private transient FieldRecord[] $RECORDS = new FieldRecord[] {
                                $RECORD$map_iterator
                            };

                        {
                            $CHECKPOINT.addObject(new _PROXY_());
                        }

                    };
                }

                final class _PROXY_ implements Rollbackable {

                    public final void $COMMIT(long timestamp) {
                        $COMMIT_ANONYMOUS(timestamp);
                    }

                    public final void $RESTORE(long timestamp, boolean trim) {
                        $RESTORE_ANONYMOUS(timestamp, trim);
                    }

                    public final Checkpoint $GET$CHECKPOINT() {
                        return $GET$CHECKPOINT_ANONYMOUS();
                    }

                    public final Object $SET$CHECKPOINT(Checkpoint checkpoint) {
                        $SET$CHECKPOINT_ANONYMOUS(checkpoint);
                        return this;
                    }

                }

                public void $COMMIT_ANONYMOUS(long timestamp) {
                    FieldRecord.commit($RECORDS, timestamp, $RECORD$$CHECKPOINT.getTopTimestamp());
                    super.$COMMIT(timestamp);
                }

                public void $RESTORE_ANONYMOUS(long timestamp, boolean trim) {
                    super.$RESTORE(timestamp, trim);
                }

                public final Checkpoint $GET$CHECKPOINT_ANONYMOUS() {
                    return $CHECKPOINT;
                }

                public final Object $SET$CHECKPOINT_ANONYMOUS(Checkpoint checkpoint) {
                    if ($CHECKPOINT != checkpoint) {
                        Checkpoint oldCheckpoint = $CHECKPOINT;
                        if (checkpoint != null) {
                            $RECORD$$CHECKPOINT.add($CHECKPOINT, checkpoint.getTimestamp());
                            FieldRecord.pushState($RECORDS);
                        }
                        $CHECKPOINT = checkpoint;
                        oldCheckpoint.setCheckpoint(checkpoint);
                        checkpoint.addObject(new _PROXY_());
                    }
                    return this;
                }
View Full Code Here

        return $CHECKPOINT;
    }

    public final Object $SET$CHECKPOINT(Checkpoint checkpoint) {
        if ($CHECKPOINT != checkpoint) {
            Checkpoint oldCheckpoint = $CHECKPOINT;
            if (checkpoint != null) {
                $RECORD$$CHECKPOINT.add($CHECKPOINT, checkpoint.getTimestamp());
                FieldRecord.pushState($RECORDS);
            }
            $CHECKPOINT = checkpoint;
            oldCheckpoint.setCheckpoint(checkpoint);
            checkpoint.addObject(this);
        }
        return this;
    }
View Full Code Here

            return $CHECKPOINT;
        }

        public final Object $SET$CHECKPOINT(Checkpoint checkpoint) {
            if ($CHECKPOINT != checkpoint) {
                Checkpoint oldCheckpoint = $CHECKPOINT;
                if (checkpoint != null) {
                    $RECORD$$CHECKPOINT.add($CHECKPOINT, checkpoint.getTimestamp());
                    FieldRecord.pushState($RECORDS);
                }
                $CHECKPOINT = checkpoint;
                oldCheckpoint.setCheckpoint(checkpoint);
                checkpoint.addObject(this);
            }
            return this;
        }
View Full Code Here

                    return $CHECKPOINT;
                }

                public final Object $SET$CHECKPOINT_ANONYMOUS(Checkpoint checkpoint) {
                    if ($CHECKPOINT != checkpoint) {
                        Checkpoint oldCheckpoint = $CHECKPOINT;
                        if (checkpoint != null) {
                            $RECORD$$CHECKPOINT.add($CHECKPOINT, checkpoint.getTimestamp());
                            FieldRecord.pushState($RECORDS);
                        }
                        $CHECKPOINT = checkpoint;
                        oldCheckpoint.setCheckpoint(checkpoint);
                        checkpoint.addObject(new _PROXY_());
                    }
                    return this;
                }
View Full Code Here

            return $CHECKPOINT;
        }

        public final Object $SET$CHECKPOINT(Checkpoint checkpoint) {
            if ($CHECKPOINT != checkpoint) {
                Checkpoint oldCheckpoint = $CHECKPOINT;
                if (checkpoint != null) {
                    $RECORD$$CHECKPOINT.add($CHECKPOINT, checkpoint.getTimestamp());
                    FieldRecord.pushState($RECORDS);
                }
                $CHECKPOINT = checkpoint;
                oldCheckpoint.setCheckpoint(checkpoint);
                checkpoint.addObject(this);
            }
            return this;
        }
View Full Code Here

    private void _checkpoint(HashMap<Checkpoint, Long> handles,
            CompositeActor container) {
        Iterator entities = container.entityList(Rollbackable.class).iterator();
        while (entities.hasNext()) {
            Rollbackable entity = (Rollbackable) entities.next();
            Checkpoint checkpointObject = entity.$GET$CHECKPOINT();
            if (!handles.containsKey(checkpointObject)) {
                long handle = checkpointObject.createCheckpoint();
                handles.put(checkpointObject, Long.valueOf(handle));
            }
        }

        Iterator compositeActors = container.entityList(CompositeActor.class)
View Full Code Here

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

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

                if (!checkpoints.contains(checkpoint)) {
                    // Rollback with the current timestamp.
                    // States taken at the time when the timestamp is created
                    // are restored to the actors managed by this checkpoint
                    // object.
                    checkpoint.rollback(checkpoint.getTimestamp(), true);
                    checkpoints.add(checkpoint);
                }
            }
        }
    }
View Full Code Here

        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);
                }
            }
        }
    }
View Full Code Here

                        return $CHECKPOINT;
                    }

                    public final Object $SET$CHECKPOINT_ANONYMOUS(Checkpoint checkpoint) {
                        if ($CHECKPOINT != checkpoint) {
                            Checkpoint oldCheckpoint = $CHECKPOINT;
                            if (checkpoint != null) {
                                $RECORD$$CHECKPOINT.add($CHECKPOINT, checkpoint.getTimestamp());
                                FieldRecord.pushState($RECORDS);
                            }
                            $CHECKPOINT = checkpoint;
                            oldCheckpoint.setCheckpoint(checkpoint);
                            checkpoint.addObject(new _PROXY_());
                        }
                        return this;
                    }
View Full Code Here

TOP

Related Classes of ptolemy.backtrack.Checkpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.