Class ObjectStore
java.lang.Object
com.arjuna.ats.arjuna.objectstore.ObjectStore
- All Implemented Interfaces:
BaseStore,ObjectStoreAPI,ParticipantStore,RecoveryStore,TxLog
The object store interface is the application's route to using
a specific object store implementation. The interface dynamically
binds to an implementation of the right type.
This is the base class from which all object store types are derived.
Note that because object store instances are stateless, to improve
efficiency we try to only create one instance of each type per process.
Therefore, the create and destroy methods are used instead of new
and delete. If an object store is accessed via create it *must* be
deleted using destroy. Of course it is still possible to make use of
new directly.
- Since:
- JTS 1.0.
- Version:
- $Id: ObjectStore.java 2342 2006-03-30 13:06:17Z $
- Author:
- Mark Little (mark@arjuna.com)
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedObjectStore(ObjectStoreEnvironmentBean objectStoreEnvironmentBean) -
Method Summary
Modifier and TypeMethodDescriptionbooleanallObjUids(String s, InputObjectState buff) Obtain all of the Uids for a specified type, regardless of their state.booleanDoes this store need to do the full write_uncommitted/commit protocol?final voidinitialise(Uid u, String tn) Initialise the object store.booleanIs the current state of the object the same as that provided as the last parameter?locateStore(String localOSRoot) protected StringrevealedId(String name) Given a type id which is possibly hidden (e.g., has a ! at the end), make it a valid Uid so we can return it.final intvoidstart()voidstop()final StringstoreDir()final Stringprotected abstract booleansupressEntry(String name) Suppress directories of the specified type from allTypes etc?voidsync()Some object store implementations may be running with automatic sync disabled.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.arjuna.ats.arjuna.objectstore.BaseStore
getStoreNameMethods inherited from interface com.arjuna.ats.arjuna.objectstore.ParticipantStore
commit_state, read_committed, read_uncommitted, remove_uncommitted, write_uncommittedMethods inherited from interface com.arjuna.ats.arjuna.objectstore.RecoveryStore
allObjUids, allTypes, currentState, hide_state, read_committed, reveal_stateMethods inherited from interface com.arjuna.ats.arjuna.objectstore.TxLog
remove_committed, write_committed
-
Field Details
-
_objectStoreRoot
-
Constructor Details
-
ObjectStore
protected ObjectStore(ObjectStoreEnvironmentBean objectStoreEnvironmentBean) throws ObjectStoreException - Throws:
ObjectStoreException
-
-
Method Details
-
start
public void start() -
stop
public void stop() -
allObjUids
Description copied from interface:RecoveryStoreObtain all of the Uids for a specified type, regardless of their state.- Specified by:
allObjUidsin interfaceRecoveryStore- Parameters:
s- The type to scan for.buff- The object state in which to store the Uids- Returns:
trueif no errors occurred,falseotherwise.- Throws:
ObjectStoreException
-
sync
Some object store implementations may be running with automatic sync disabled. Calling this method will ensure that any states are flushed to disk.- Specified by:
syncin interfaceTxLog- Throws:
SyncFailedExceptionObjectStoreException
-
locateStore
- Parameters:
localOSRoot- the root of the store.- Returns:
- the full path of the store. localOSRoot is always a relative name. NOTE this path always ends in a /
- Throws:
ObjectStoreException
-
fullCommitNeeded
public boolean fullCommitNeeded()Does this store need to do the full write_uncommitted/commit protocol?- Specified by:
fullCommitNeededin interfaceParticipantStore- Returns:
trueif full commit is needed,falseotherwise.
-
isType
Is the current state of the object the same as that provided as the last parameter?- Specified by:
isTypein interfaceRecoveryStore- Parameters:
u- The object to work on.tn- The type of the object.st- The expected type of the object.- Returns:
trueif the current state is as expected,falseotherwise.- Throws:
ObjectStoreException
-
initialise
Initialise the object store. -
storeDir
-
storeRoot
-
supressEntry
Suppress directories of the specified type from allTypes etc? -
revealedId
Given a type id which is possibly hidden (e.g., has a ! at the end), make it a valid Uid so we can return it.
-