public abstract class AbstractRecord extends StateManager
modifyingActions, objectModel, objectUid, usingActions| Modifier | Constructor and Description |
|---|---|
|
AbstractRecord()
Creates a 'blank' abstract record.
|
protected |
AbstractRecord(Uid storeUid)
Create a new instance with the specified paramaters.
|
protected |
AbstractRecord(Uid storeUid,
String objType,
int otype)
Create a new instance with the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
alter(AbstractRecord a)
Alter the current record with the one presented.
|
static AbstractRecord |
create(int type) |
boolean |
doSave()
Should this record be saved in the intentions list? If the record is
saved, then it may be recovered later in the event of a failure.
|
boolean |
equals(AbstractRecord ar)
Determine if two records are equal in that both are the same type and
have the same order value (determined via 'order()').
|
boolean |
forgetHeuristic()
Forget any heuristic outcome which this implementation may have produced.
|
protected AbstractRecord |
getNext() |
protected AbstractRecord |
getPrevious()
These few functions are link manipulation primitives used by the
RecordList processing software to chain instances together.
|
String |
getTypeOfObject()
Return the type of the abstract record.
|
boolean |
greaterThan(AbstractRecord ar)
Determine if two records are greater than in that both are the same type
and their Uids are greater than.
|
boolean |
lessThan(AbstractRecord ar)
Determine if two records are less than in that both are the same type and
their Uids are less than.
|
abstract void |
merge(AbstractRecord a)
Merge the current record with the one presented.
|
abstract int |
nestedAbort()
A rollback of a nested transaction has occurred.
|
int |
nestedCleanup()
Cleanup is called if a nested is detected to be an orphan.
|
abstract int |
nestedCommit()
A commit of a nested transaction has occurred.
|
int |
nestedOnePhaseCommit()
Perform a nested one phase commit.
|
abstract int |
nestedPrepare()
A prepare for a nested transaction has occurred.
|
Uid |
order()
Return the Uid of this abstract record so that it can be ordered in the
intentions list.
|
void |
print(PrintWriter strm)
Write information about this specific instance to the specified stream.
|
boolean |
propagateOnAbort()
Determine if records are discarded on action abort or must be propagated
to parents.
|
boolean |
propagateOnCommit()
Determine if records are discarded on action commit or must be propagated
to parents.
|
void |
replace(AbstractRecord a)
The current record is about to replace the one presented.
|
boolean |
restore_state(InputObjectState os,
int i)
During recovery, the transaction log is given to the recovery system and
it will recreate a transaction instance to perform necessary recovery
actions.
|
boolean |
save_state(OutputObjectState os,
int i)
When the transaction is required to make the intentions list persistent,
it scans the list and asks each record whether or not it requires state
to be saved (by calling doSave).
|
protected void |
setNext(AbstractRecord ar)
Set the next element in the list to the specified instance.
|
protected void |
setPrevious(AbstractRecord ar)
Set the previous element in the list to the specified instance.
|
abstract void |
setValue(Object o) |
abstract boolean |
shouldAdd(AbstractRecord a)
Should we add the record presented to the intentions list?
|
abstract boolean |
shouldAlter(AbstractRecord a)
Should we alter the current record with the one presented?
|
abstract boolean |
shouldMerge(AbstractRecord a)
Should we merge the current record with the one presented?
|
abstract boolean |
shouldReplace(AbstractRecord a)
Should we replace the record presented with the current record?
|
abstract int |
topLevelAbort()
A rollback of a top-level transaction has occurred.
|
int |
topLevelCleanup()
Cleanup is called if a top-level action is detected to be an orphan.
|
abstract int |
topLevelCommit()
A commit of a top-level transaction has occurred.
|
int |
topLevelOnePhaseCommit()
Perform a top-level one phase commit.
|
abstract int |
topLevelPrepare()
A prepare for a top-level transaction has occurred.
|
String |
type()
Re-implementation of abstract methods inherited from base class.
|
abstract int |
typeIs() |
abstract Object |
value()
If this abstract record caused a heuristic then it should return an
object which implements
HeuristicInformation |
activate, activate, cleanup, deactivate, deactivate, deactivate, destroy, disable, forgetAction, get_uid, getMutex, getObjectModel, getStore, getStoreRoot, loadObjectState, lockMutex, modified, objectType, packHeader, persist, rememberAction, setStatus, setupStore, setupStore, setupStore, status, terminate, tryLockMutex, unlockMutex, unpackHeaderprotected AbstractRecord(Uid storeUid, String objType, int otype)
storeUid - the unique id for this instance.objType - the type of the instance.otype - the ObjectType of the object.ObjectTypeprotected AbstractRecord(Uid storeUid)
storeUid - the unique id for this instance.public AbstractRecord()
public abstract int typeIs()
RecordType value.public abstract Object value()
HeuristicInformationObject to be used to order.public abstract void setValue(Object o)
public abstract int nestedAbort()
TwoPhaseOutcome to indicate success/failure.TwoPhaseOutcomepublic abstract int nestedCommit()
TwoPhaseOutcome to indicate success/failure.TwoPhaseOutcomepublic abstract int nestedPrepare()
TwoPhaseOutcome to indicate success/failure.TwoPhaseOutcomepublic abstract int topLevelAbort()
TwoPhaseOutcome to indicate success/failure.TwoPhaseOutcomepublic abstract int topLevelCommit()
TwoPhaseOutcome to indicate success/failure.TwoPhaseOutcomepublic abstract int topLevelPrepare()
TwoPhaseOutcome to indicate success/failure.TwoPhaseOutcomepublic Uid order()
Uid for this instance.Uidpublic String getTypeOfObject()
String representing type.public boolean propagateOnAbort()
true if the record should be propagated to the
parent transaction if the current transaction rolls back,
false otherwise. The default is false.public boolean propagateOnCommit()
true if the record should be propagated to the
parent transaction if the current transaction commits,
false otherwise. The default is true.public final boolean equals(AbstractRecord ar)
true if equal, false otherwise.public final boolean lessThan(AbstractRecord ar)
true if equal, false otherwise.public final boolean greaterThan(AbstractRecord ar)
true if equal, false otherwise.public int topLevelCleanup()
TwoPhaseOutcome as default is the same as
topLevelAbort.public int nestedCleanup()
TwoPhaseOutcome as default is the same as
nestedAbort.public boolean doSave()
true if it should be saved, false
otherwise. false is the default.public String type()
type in class StateManagerpublic void print(PrintWriter strm)
print in class StateManagerstrm - the stream on which to output.public boolean save_state(OutputObjectState os, int i)
save_state in class StateManagertrue if successful, false
otherwise.public boolean restore_state(InputObjectState os, int i)
restore_state in class StateManagertrue if successful, false
otherwise.public boolean forgetHeuristic()
true by default. If false is
returned then the instance must be remembered by the transaction
(in the log) in order for recovery to retry later or for a system
administrator to be able to determine which resources have not
been successfully completed.public int nestedOnePhaseCommit()
TwoPhaseOutcome to indicate success/failure.TwoPhaseOutcomepublic int topLevelOnePhaseCommit()
TwoPhaseOutcome to indicate success/failure.TwoPhaseOutcomepublic static AbstractRecord create(int type)
public abstract void merge(AbstractRecord a)
a - the record with which to merge.public abstract void alter(AbstractRecord a)
a - the record with which to alter.public abstract boolean shouldAdd(AbstractRecord a)
a - The record to try to add.true if the record should be added,
false otherwise.public abstract boolean shouldAlter(AbstractRecord a)
a - The record to try to alter.true if the record should be altered,
false otherwise.public abstract boolean shouldMerge(AbstractRecord a)
a - The record to try to merge.true if the record should be merged,
false otherwise.public abstract boolean shouldReplace(AbstractRecord a)
a - The record to try to replace.true if the record should be replaced,
false otherwise.public void replace(AbstractRecord a)
a - the record that will replace this instance.protected final AbstractRecord getPrevious()
protected final AbstractRecord getNext()
protected final void setPrevious(AbstractRecord ar)
ar - the instance to become previous.protected final void setNext(AbstractRecord ar)
ar - the instance to become next.Copyright © 2014. All Rights Reserved.