checkpoint.addObject(this);
}
return this;
}
protected transient CheckpointRecord $RECORD$$CHECKPOINT = new CheckpointRecord();
private transient FieldRecord[] $RECORDS = new FieldRecord[] {
};
}
// class SynchronizedMapEntry
// Now the actual code.
if (entries == null)
synchronized (mutex) {
$ASSIGN$entries(new SynchronizedSet(mutex, m.entrySet()) {
/**
* Returns an iterator over the set. The iterator has no specific order,
* unless further specified. A lock is obtained on the set's mutex
* before the iterator is created. The created iterator is also
* thread-safe.
* @return A synchronized set iterator.
*/
public Iterator iterator() {
synchronized (super.mutex) {
return new SynchronizedIterator(super.mutex, c.iterator()) {
/**
* Retrieves the next map entry from the iterator.
* A lock is obtained on the iterator's mutex before
* the entry is created. The new map entry is enclosed in
* a thread-safe wrapper.
* @return A synchronized map entry.
*/
public Object next() {
synchronized (super.mutex) {
return new SynchronizedMapEntry(super.next());
}
}
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;
}
private transient FieldRecord[] $RECORDS = new FieldRecord[] {
};
{
$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_());