T - The referenced value type.public class TransactionalRef<T> extends SemiPersistent<TransactionalRef<T>> implements Ref<T>
| Constructor and Description |
|---|
TransactionalRef()
Constructs the reference object with null as value.
|
TransactionalRef(T value)
Constructs the reference object with the given value.
|
| Modifier and Type | Method and Description |
|---|---|
T |
assoc(T newValue)
Associates this reference with another value.
|
TransactionalRef<T> |
cleanCopy()
Creates a new transactional entity from the current one discarding all the local changes.
|
TransactionalRef<T> |
commit(TransactionalRef<T> globalState) |
T |
deref()
Returns kept value.
|
protected TransactionalRef<T> |
dirtyCopy()
Copies references to the source data along with local changes and read/write logs.
|
protected void |
update(TransactionalRef<T> changes,
boolean onlyReadLogs)
Updates local changes and change logs using change logs of the arguments.
|
public TransactionalRef()
public TransactionalRef(T value)
value - The initial value.public T assoc(T newValue)
Refpublic TransactionalRef<T> cleanCopy()
SemiPersistentcleanCopy in class SemiPersistent<TransactionalRef<T>>protected TransactionalRef<T> dirtyCopy()
SemiPersistentSemiPersistent#update(Object) will not work.dirtyCopy in class SemiPersistent<TransactionalRef<T>>protected void update(TransactionalRef<T> changes, boolean onlyReadLogs)
SemiPersistentSemiPersistent.dirtyCopy(). update in class SemiPersistent<TransactionalRef<T>>changes - The branched collection possibly with updates.onlyReadLogs - If true only read logs are updated. Useful for read-only transactions.public TransactionalRef<T> commit(TransactionalRef<T> globalState)
Copyright © 2013 CERN, The European Organization for Nuclear Research. All Rights Reserved.