Class CacheStore
- All Implemented Interfaces:
BaseStore
,ObjectStoreAPI
,ParticipantStore
,RecoveryStore
,TxLog
A cached object store implementation.
- Since:
- JTS 3.0.
- Version:
- $Id: CacheStore.java 2342 2006-03-30 13:06:17Z $
- Author:
- Mark Little (mark@arjuna.com)
-
Field Summary
Fields inherited from class com.arjuna.ats.internal.arjuna.objectstore.HashedStore
DEFAULT_NUMBER_DIRECTORIES, SHADOWCHAR
Fields inherited from class com.arjuna.ats.internal.arjuna.objectstore.ShadowingStore
HIDDINGCHAR
Fields inherited from class com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore
doSync, scanZeroLengthFiles, syncWrites
Fields inherited from class com.arjuna.ats.arjuna.objectstore.ObjectStore
_objectStoreRoot, shareStatus
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
commit_state
(Uid objUid, String tName) Commit a previous write_state operation which was made with the SHADOW StateType argument.protected boolean
commitState
(Uid objUid, String tName) protected InputObjectState
read_state
(Uid objUid, String tName, int ft) Before we look at the disk let's look in the state cache first for the state, just in case it hasn't been written out to persistent store yet.protected boolean
remove_state
(Uid objUid, String name, int ft) protected boolean
removeState
(Uid objUid, String name, int ft) void
sync()
Some object store implementations may be running with automatic sync disabled.protected boolean
write_state
(Uid objUid, String tName, OutputObjectState state, int ft) write_state saves the ObjectState in a file named by the type and Uid of the ObjectState.protected boolean
writeState
(Uid objUid, String tName, OutputObjectState state, int ft) Methods inherited from class com.arjuna.ats.internal.arjuna.objectstore.HashedStore
allObjUids, genPathName, truncate
Methods inherited from class com.arjuna.ats.internal.arjuna.objectstore.ShadowNoFileLockStore
lock, unlock
Methods inherited from class com.arjuna.ats.internal.arjuna.objectstore.ShadowingStore
currentState, hide_state, reveal_state, revealedId
Methods inherited from class com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore
addToCache, allTypes, allTypes, closeAndUnlock, createHierarchy, exists, getStoreName, openAndLock, read_committed, read_uncommitted, remove_committed, remove_uncommitted, removeFromCache, removeFromCache, renameFromTo, renameFromToInternal, supressEntry, synchronousWrites, write_committed, write_uncommitted
Methods inherited from class com.arjuna.ats.arjuna.objectstore.ObjectStore
allObjUids, fullCommitNeeded, initialise, isType, locateStore, shareState, start, stop, storeDir, storeRoot
-
Constructor Details
-
CacheStore
public CacheStore(ObjectStoreEnvironmentBean objectStoreEnvironmentBean) throws ObjectStoreException - Throws:
ObjectStoreException
-
-
Method Details
-
commit_state
Description copied from class:ShadowingStore
Commit a previous write_state operation which was made with the SHADOW StateType argument. This is achieved by renaming the shadow and removing the hidden version.- Specified by:
commit_state
in interfaceParticipantStore
- Overrides:
commit_state
in classShadowingStore
- Parameters:
objUid
- The object to work on.tName
- The type of the object to work on.- Returns:
true
if no errors occurred,false
otherwise.- Throws:
ObjectStoreException
-
sync
Description copied from class:ObjectStore
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:
sync
in interfaceTxLog
- Overrides:
sync
in classObjectStore
- Throws:
SyncFailedException
ObjectStoreException
-
remove_state
- Overrides:
remove_state
in classShadowingStore
- Throws:
ObjectStoreException
-
write_state
protected boolean write_state(Uid objUid, String tName, OutputObjectState state, int ft) throws ObjectStoreException Description copied from class:ShadowingStore
write_state saves the ObjectState in a file named by the type and Uid of the ObjectState. If the second argument is SHADOW, then the file name is different so that a subsequent commit_state invocation will rename the file.- Overrides:
write_state
in classShadowingStore
- Throws:
ObjectStoreException
-
read_state
Before we look at the disk let's look in the state cache first for the state, just in case it hasn't been written out to persistent store yet.- Overrides:
read_state
in classShadowingStore
- Throws:
ObjectStoreException
-
commitState
- Throws:
ObjectStoreException
-
removeState
- Throws:
ObjectStoreException
-
writeState
protected boolean writeState(Uid objUid, String tName, OutputObjectState state, int ft) throws ObjectStoreException - Throws:
ObjectStoreException
-