|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.arjuna.ats.arjuna.StateManager
The root of the Arjuna class hierarchy. This class provides state management facilities than can be automatically used by other classes by inheritance.
Field Summary | |
protected java.util.Hashtable |
modifyingActions
|
protected ObjectName |
objectName
|
protected Uid |
objectUid
|
protected StateManagerAttribute |
smAttributes
|
protected java.util.Hashtable |
usingActions
|
Constructor Summary | |
protected |
StateManager()
|
protected |
StateManager(int ot)
|
protected |
StateManager(int ot,
ObjectName objName)
|
protected |
StateManager(ObjectName objName)
|
protected |
StateManager(Uid objUid)
Create object with specific uid. |
protected |
StateManager(Uid objUid,
int ot)
|
protected |
StateManager(Uid objUid,
int ot,
ObjectName objName)
|
protected |
StateManager(Uid objUid,
ObjectName attr)
|
Method Summary | |
boolean |
activate()
This operation activates an object. |
boolean |
activate(java.lang.String rootName)
This operation activates an object. |
java.lang.Object |
attributes()
|
protected void |
cleanup(boolean fromTerminate)
Object cleanup. |
boolean |
deactivate()
This operation deactivates a persistent object. |
boolean |
deactivate(java.lang.String rootName)
This operation deactivates a persistent object. |
boolean |
deactivate(java.lang.String rootName,
boolean commit)
This operation deactivates a persistent object. |
boolean |
destroy()
Destroy the object (e.g., remove its state from the persistent store.) Calls to destroy for volatile objects (ones not maintained within the volatile object store) are ignored, and FALSE is returned. |
void |
disable()
The following function disables recovery for an object by setting the ObjectType to NEITHER (RECOVERABLE or ANDPERSISTENT). |
void |
finalize()
Destructor. |
protected boolean |
forgetAction(BasicAction action,
boolean committed,
int recordType)
Remove action from list of using actions. |
Uid |
get_uid()
|
protected Mutex |
getMutex()
|
ObjectStore |
getStore()
|
java.lang.String |
getStoreRoot()
|
protected boolean |
loadObjectState()
Do we need to load the object's state? |
protected boolean |
lockMutex()
|
protected boolean |
modified()
The object's state is about to be modified, and StateManager should take a snapshot of the state if the object is being used within a transaction. |
int |
ObjectType()
|
protected void |
packHeader(OutputObjectState os,
Uid txId,
Uid processUid)
Pack the necessary information for crash recovery. |
protected void |
persist()
The persist function changes the type of the object from RECOVERABLE to ANDPERSISTENT. |
void |
print(java.io.PrintWriter strm)
Print out information about the object. |
protected boolean |
rememberAction(BasicAction action,
int recordType)
Remember that the specified transaction is using the object. |
boolean |
restore_state(InputObjectState os,
int ot)
These methods must be provided by a derived class. |
boolean |
save_state(OutputObjectState os,
int ot)
These methods must be used by a derived class. |
protected void |
setStatus(int s)
|
protected void |
setupStore()
Make sure the object store is set up, if required. |
protected void |
setupStore(java.lang.String rootName)
Make sure the object store is set up, if required. |
int |
status()
|
protected void |
terminate()
The following function checks to see if the object is going out of scope while an action is still running. |
protected boolean |
tryLockMutex()
|
java.lang.String |
type()
The object's type. |
protected boolean |
unlockMutex()
|
protected void |
unpackHeader(InputObjectState os,
Uid txId,
Uid processUid)
Unpack the crash recovery state header information and return it. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected StateManagerAttribute smAttributes
protected ObjectName objectName
protected java.util.Hashtable modifyingActions
protected java.util.Hashtable usingActions
protected Uid objectUid
Constructor Detail |
protected StateManager(Uid objUid)
protected StateManager(Uid objUid, ObjectName attr)
protected StateManager(Uid objUid, int ot)
protected StateManager(Uid objUid, int ot, ObjectName objName)
protected StateManager()
protected StateManager(int ot)
protected StateManager(int ot, ObjectName objName)
protected StateManager(ObjectName objName)
Method Detail |
public boolean save_state(OutputObjectState os, int ot)
true
on success, false
otherwise.public boolean restore_state(InputObjectState os, int ot)
true
on success, false
otherwise.public void finalize() throws java.lang.Throwable
java.lang.Throwable
public boolean activate()
null
.
true
on success, false
otherwise.ObjectStore
public boolean activate(java.lang.String rootName)
true
on success, false
otherwise.ObjectStore
public boolean deactivate()
null
. It is assumed
that this is being called during a transaction commit.
true
on success, false
otherwise.public boolean deactivate(java.lang.String rootName)
true
on success, false
otherwise.public boolean deactivate(java.lang.String rootName, boolean commit)
true
on success, false
otherwise.public int status()
public int ObjectType()
public final Uid get_uid()
public boolean destroy()
true
on success, false
otherwise.public void disable()
public void print(java.io.PrintWriter strm)
public java.lang.String type()
public final java.lang.String getStoreRoot()
public ObjectStore getStore()
public java.lang.Object attributes()
protected void packHeader(OutputObjectState os, Uid txId, Uid processUid) throws java.io.IOException
java.io.IOException
protected void unpackHeader(InputObjectState os, Uid txId, Uid processUid) throws java.io.IOException
txId
- the identity of the transaction that last caused the
state to be written to the object store.
Uid
of the process that last managed this
state.
java.io.IOException
protected void terminate()
protected final void setStatus(int s)
protected boolean modified()
true
on success, false
otherwise.protected final void persist()
protected final void cleanup(boolean fromTerminate)
fromTerminate
- indicates whether this method is being called
from the terminate
method, or from elsewhere.terminate()
protected final void setupStore()
null
.
protected void setupStore(java.lang.String rootName)
rootName
- indicates the root of the object store.protected final boolean loadObjectState()
true
if the object state should be loaded,
false
otherwise.protected final boolean forgetAction(BasicAction action, boolean committed, int recordType)
protected final boolean rememberAction(BasicAction action, int recordType)
protected final Mutex getMutex()
protected final boolean lockMutex()
protected final boolean unlockMutex()
protected final boolean tryLockMutex()
true
if the object was locked,
false
if the attempt would cause the thread to block.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |