|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A StateManager is used by the PersistenceManager and the ConcurrencyManager in order to manage the life cycle of cache entries and their states. This management concerns the java life cycle of the state instance (create, destroy) and the status (dirty, new, deleted, ...). This interface is implemented by the Personality using the persistence framework of Perseus.
Field Summary | |
static int |
CACHING_STRATEGY_ALL
The states of the persistent objects must be kept in the cache. |
static int |
CACHING_STRATEGY_CACHED
The states of the persistent objects must be kept in the cache |
static int |
CACHING_STRATEGY_FIXED
The states of the persistent objects must be kept in the cache. |
static int |
CACHING_STRATEGY_NO_CACHE
The states of the persistent objects must not be kept in the cache |
Method Summary | |
State |
createState(CacheEntry ce)
Creates a new State. |
void |
destroyState(State state)
Removes a state. |
int |
getCachingStrategy(java.lang.Object o)
Indicates the caching strategy for a persistent class. |
State |
getReferenceState(CacheEntry ce)
|
boolean |
isBound(CacheEntry ce)
|
boolean |
isDirty(State state)
|
boolean |
isExported(State state)
|
boolean |
isFlushed(State state)
|
boolean |
isToMerge(State state)
Indicates if a State has to be merged at commit time with the reference state |
boolean |
isUnexported(State state)
|
void |
makeBound(CacheEntry ce,
java.lang.Object oid)
A persistent object has been removed or evicted from the cache, then it must be marked as non persistent |
void |
makeClean(State state)
Marks the status of the state to 'clean' (non modified). |
void |
makeDirty(State state)
Marks the status of the state to 'dirty' (modified). |
void |
makeExported(State state)
Marks the status of the state to 'exported' (created). |
void |
makeFlushed(State state)
Marks the status of the state to 'flushed' (written on data support). |
void |
makeToMerge(State state,
java.lang.Object thinLock)
Marks the flag 'toMerge' on a state. a true value indicates that the state has to be merged at commit time, with the reference state. |
void |
makeUnbound(CacheEntry ce)
A persistent object has been removed or evicted from the cache, then it must be marked as non persistent |
void |
makeUnexported(State state)
Marks the status of the state to 'unexported' (deleted). |
State |
merge(State oldState,
State newState)
Merges a state (newState) into a oldSate. |
void |
setReferenceState(CacheEntry ce,
State state)
Assignes the reference state to a cache entry |
void |
stateNoMoreUsed(State state)
Indicates that this state is no more used by any working set. |
Field Detail |
public static final int CACHING_STRATEGY_NO_CACHE
public static final int CACHING_STRATEGY_CACHED
public static final int CACHING_STRATEGY_FIXED
public static final int CACHING_STRATEGY_ALL
Method Detail |
public State createState(CacheEntry ce)
public State getReferenceState(CacheEntry ce)
ce
- is the cache entry when the reference state is asked
public void setReferenceState(CacheEntry ce, State state)
ce
- is the cache entry which the reference state must be changedstate
- is the new value of the reference state. If this parameter
is null, that means the CacheEntry does not have a state in memory, it
is hollow.public void destroyState(State state)
state
- the state to destroypublic void makeUnexported(State state)
public boolean isUnexported(State state)
public void makeExported(State state)
public boolean isExported(State state)
public void makeDirty(State state)
public boolean isDirty(State state)
public void makeClean(State state)
public void makeFlushed(State state)
state
- public boolean isFlushed(State state)
public void makeUnbound(CacheEntry ce)
ce
- is the cache entry referenced the persistent object to unbindpublic void makeBound(CacheEntry ce, java.lang.Object oid)
ce
- is the cache entry referenced the persistent object to bindoid
- is the id of the cache entry to bindpublic boolean isBound(CacheEntry ce)
public boolean isToMerge(State state)
public void makeToMerge(State state, java.lang.Object thinLock)
state
- thinLock
- is a hints describing the thinlock causing the merge
at commit time.public State merge(State oldState, State newState)
oldState
- is the state wich will contains the delta of the newStatenewState
- contains the delta to merge to the oldStatepublic void stateNoMoreUsed(State state)
state
- is the state that is not used by any working setpublic int getCachingStrategy(java.lang.Object o)
o
- is a persistent object or its identifierCACHING_STRATEGY_NO_CACHE
,
CACHING_STRATEGY_CACHED
,
CACHING_STRATEGY_FIXED
,
CACHING_STRATEGY_ALL
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |