public class StateManager extends Object
Modifier and Type | Field and Description |
---|---|
protected Hashtable |
modifyingActions |
protected int |
objectModel |
protected Uid |
objectUid |
protected Hashtable |
usingActions |
Modifier | Constructor and Description |
---|---|
protected |
StateManager() |
protected |
StateManager(int ot) |
protected |
StateManager(int ot,
int om) |
protected |
StateManager(Uid objUid)
Create object with specific uid.
|
protected |
StateManager(Uid objUid,
int ot) |
protected |
StateManager(Uid objUid,
int ot,
int om) |
Modifier and Type | Method and Description |
---|---|
boolean |
activate()
This operation activates an object.
|
boolean |
activate(String rootName)
This operation activates an object.
|
protected void |
cleanup(boolean fromTerminate)
Object cleanup.
|
protected void |
createLists() |
boolean |
deactivate()
This operation deactivates a persistent object.
|
boolean |
deactivate(String rootName)
This operation deactivates a persistent object.
|
boolean |
deactivate(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).
|
protected boolean |
forgetAction(BasicAction action,
boolean committed,
int recordType)
Remove action from list of using actions.
|
Uid |
get_uid() |
protected ReentrantLock |
getMutex() |
int |
getObjectModel() |
ParticipantStore |
getStore() |
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,
com.arjuna.ats.internal.arjuna.Header hdr)
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(PrintWriter strm)
Print out information about the object.
|
protected boolean |
rememberAction(BasicAction action,
int recordType,
int state)
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(String rootName) |
protected void |
setupStore(String rootName,
String objectStoreType)
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() |
String |
type()
The object's type.
|
protected boolean |
unlockMutex() |
protected void |
unpackHeader(InputObjectState os,
com.arjuna.ats.internal.arjuna.Header hdr)
Unpack the crash recovery state header information and return it.
|
protected Hashtable modifyingActions
protected Hashtable usingActions
protected final Uid objectUid
protected int objectModel
protected StateManager(Uid objUid)
protected StateManager(Uid objUid, int ot)
protected StateManager(Uid objUid, int ot, int om)
protected StateManager()
protected StateManager(int ot)
protected StateManager(int ot, int om)
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 boolean activate()
null
.true
on success, false
otherwise.ObjectStore
public boolean activate(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(String rootName)
true
on success, false
otherwise.public boolean deactivate(String rootName, boolean commit)
true
on success, false
otherwise.public int status()
public int objectType()
public int getObjectModel()
public final Uid get_uid()
public boolean destroy()
true
on success, false
otherwise.public void disable()
public void print(PrintWriter strm)
public String type()
public final String getStoreRoot()
public ParticipantStore getStore()
protected void packHeader(OutputObjectState os, com.arjuna.ats.internal.arjuna.Header hdr) throws IOException
IOException
protected void unpackHeader(InputObjectState os, com.arjuna.ats.internal.arjuna.Header hdr) throws IOException
txId
- the identity of the transaction that last caused the state to
be written to the object store.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(String rootName)
protected void setupStore(String rootName, String objectStoreType)
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, int state)
protected final ReentrantLock 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.protected void createLists()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.