T - The client SemiPersistent type.public class Memory<T extends SemiPersistent<T>> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
NUM_RETRIES
Number of retries of a transaction in case of conflicts.
|
| Constructor and Description |
|---|
Memory(T initialState)
Creates transactional memory with given initial state.
|
| Modifier and Type | Method and Description |
|---|---|
protected cern.entwined.BaseSnapshot<T> |
getBaseSnapshot()
Checks if there is a running transaction and if there is returns its snapshot.
|
protected Long |
getNextId()
Returns the next unique ID that can be used in
BaseSnapshot. |
boolean |
runTransaction(Transaction<T> transaction)
Executes a transaction and calls the given transactional user code.
|
protected static final int NUM_RETRIES
public Memory(T initialState)
initialState - The initial state of transactional memory. It takes a clean copy of it.public boolean runTransaction(Transaction<T> transaction)
transaction - The transaction interface implementation.true if committed, false if rolled back.protected cern.entwined.BaseSnapshot<T> getBaseSnapshot()
MemoryException - if there is no running transaction.protected Long getNextId()
BaseSnapshot.Copyright © 2013 CERN, The European Organization for Nuclear Research. All Rights Reserved.