|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.stms.alpha.AlphaTranlocal
public abstract class AlphaTranlocal
The Tranlocal is the Transaction local content of a TransactionalObject, since the state from the TransactionalObject is removed. So for every TransactionalObject there are 1 or more Tranlocals (or zero when the TransactionalObject is being constructed).
Semantics of version: after the Tranlocal is committed, the version contains the write version. Before the commit it contains the current read version. To support nested transactions there are partial rollbacks, each Tranlocal is able to make a snapshot of itself, so that it can be restored when a (nested) transaction rolls back. Once the Tranlocal has been committed, the fields should only be read and not written. Since the publication (commit) introduces some happens before relation, the fields in this object will also lift on that happens before relation.
| Field Summary | |
|---|---|
AlphaTranlocal |
___origin
|
AlphaTransactionalObject |
___transactionalObject
|
long |
___writeVersion
|
static long |
OPENED_FOR_COMMUTE
|
static long |
OPENED_FOR_COMMUTE_AND_DIRTY
|
static long |
OPENED_FOR_WRITE
|
static long |
OPENED_FOR_WRITE_AND_DIRTY
|
| Fields inherited from interface org.multiverse.MultiverseConstants |
|---|
___SANITY_CHECKS_ENABLED |
| Constructor Summary | |
|---|---|
AlphaTranlocal()
|
|
| Method Summary | |
|---|---|
org.multiverse.api.Transaction |
___getLockOwner()
|
void |
___releaseLock(org.multiverse.api.Transaction expectedLockOwner)
|
boolean |
___tryLock(org.multiverse.api.Transaction lockOwner)
|
boolean |
executeDirtyCheck()
Checks if the tranlocal is dirty and caches the value If the tranlocal is committed, false is returned and nothing is changed. |
AlphaTranlocal |
getOrigin()
Returns the original committed AlphaTranlocal this AlphaTranlocal is a updatable version of. |
boolean |
getPrecalculatedIsDirty()
Checks if the tranlocal is dirty by making use of a ___writeVersion that is changed by the executeDirtyCheck method. |
AlphaTransactionalObject |
getTransactionalObject()
Returns the AlphaTransactionalObject that belongs to this AlphaTranlocal. |
long |
getWriteVersion()
|
boolean |
hasReadConflict(org.multiverse.api.Transaction allowedLockOwner)
|
boolean |
hasWriteConflict()
|
boolean |
isCommitted()
|
boolean |
isCommuting()
|
abstract boolean |
isDirty()
Checks if this Tranlocal should be committed. |
boolean |
isUncommitted()
|
void |
lateFixation(AlphaTransaction tx)
|
abstract AlphaTranlocal |
openForWrite()
Returns a clone of this AlphaTranlocal to be used for updates. |
void |
prematureFixation(AlphaTransaction tx,
AlphaTranlocal origin)
|
void |
prepareForCommit(long writeVersion)
Is called just before this tranlocal commits. |
abstract AlphaTranlocalSnapshot |
takeSnapshot()
Creates the TranlocalSnapshot of the Tranlocal. |
String |
toDebugString()
Debug representation of a TransactionalObject. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long OPENED_FOR_WRITE
public static final long OPENED_FOR_WRITE_AND_DIRTY
public static final long OPENED_FOR_COMMUTE
public static final long OPENED_FOR_COMMUTE_AND_DIRTY
public long ___writeVersion
public AlphaTranlocal ___origin
public AlphaTransactionalObject ___transactionalObject
| Constructor Detail |
|---|
public AlphaTranlocal()
| Method Detail |
|---|
public final AlphaTransactionalObject getTransactionalObject()
public final AlphaTranlocal getOrigin()
public abstract AlphaTranlocalSnapshot takeSnapshot()
public abstract AlphaTranlocal openForWrite()
public final void prepareForCommit(long writeVersion)
writeVersion - the version of the commit. This is the version this tranlocal from now on will be known. It
is never going to change anymore.public abstract boolean isDirty()
public final boolean executeDirtyCheck()
public final boolean getPrecalculatedIsDirty()
public final boolean isCommitted()
public final boolean isUncommitted()
public final boolean isCommuting()
public void prematureFixation(AlphaTransaction tx,
AlphaTranlocal origin)
public void lateFixation(AlphaTransaction tx)
public final long getWriteVersion()
public final boolean hasWriteConflict()
public final boolean hasReadConflict(org.multiverse.api.Transaction allowedLockOwner)
public final org.multiverse.api.Transaction ___getLockOwner()
___getLockOwner in interface org.multiverse.api.commitlock.CommitLockpublic final boolean ___tryLock(org.multiverse.api.Transaction lockOwner)
___tryLock in interface org.multiverse.api.commitlock.CommitLockpublic final void ___releaseLock(org.multiverse.api.Transaction expectedLockOwner)
___releaseLock in interface org.multiverse.api.commitlock.CommitLockpublic String toDebugString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||