org.objectweb.perseus.persistence.api
Interface StateManager
- CacheEventListener
public interface StateManager
extends CacheEventListener
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.
- S.Chassande-Barrioz
createState
public State createState(CacheEntry ce)
Creates a new State.
- a State instance linked to its cache entry (ie the
state.getCacheEntry() must return 'ce')
createState
public State createState(State s)
Creates a new State.
s
- the state to clone
- a new state which contains the same values (data and cache entry
reference) than the existing state given in parameter
destroyState
public void destroyState(State state)
Removes a state. In general this method does nothing, but it can be used
as a listener.
state
- the state to destroy
getReferenceState
public State getReferenceState(CacheEntry ce)
ce
- is the cache entry when the reference state is asked
- the reference state of a cache entry. If no reference state
exists, the 'null' value is retrieved.
isBound
public boolean isBound(CacheEntry ce)
- true if the persistent object referenced by the given cache
entry, is persistent.
isDirty
public boolean isDirty(State state)
- true if the state has been marked as dirty, otherwise false
The state is dirty if the makeDirty or makeExported or makeUnexported
method has been called.
isExported
public boolean isExported(State state)
- true if the state has been marked as exported, otherwise false
The state is exported if the makeExported method has been called.
isFlushed
public boolean isFlushed(State state)
- true if the state has been marked as flushed without call to
makeDirty, otherwise false
isUnexported
public boolean isUnexported(State state)
- true if the state has been marked as unexported, otherwise false
The state is unexported if the makeUnexported method has been called.
makeClean
public void makeClean(State state)
Marks the status of the state to 'clean' (non modified). This method is
used at the commit of a working set in order to reset the state status.
makeDirty
public void makeDirty(State state)
Marks the status of the state to 'dirty' (modified). The next calls to
isflushed will return false.
makeExported
public void makeExported(State state)
Marks the status of the state to 'exported' (created).
makeFlushed
public void makeFlushed(State state)
Marks the status of the state to 'flushed' (written on data support).
state
-
makeUnbound
public void makeUnbound(CacheEntry ce)
A persistent object has been removed or evicted from the cache, then
it must be marked as non persistent
ce
- is the cache entry referenced the persistent object to unbind
makeUnexported
public void makeUnexported(State state)
Marks the status of the state to 'unexported' (deleted).
setReferenceState
public void setReferenceState(CacheEntry ce,
State state)
Assignes the reference state to a cache entry
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.
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.