|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.state.SharedItemStateManager
Shared ItemStateManager
. Caches objects returned from a
PersistenceManager
. Objects returned by this item state
manager are shared among all sessions.
Constructor Summary | |
SharedItemStateManager(PersistenceManager persistMgr,
String rootNodeUUID,
NodeTypeRegistry ntReg)
Creates a new SharedItemStateManager instance. |
Method Summary | |
void |
addVirtualItemStateProvider(VirtualItemStateProvider prov)
Adds a new virtual item state provider. NOTE: This method is not synchronized, because it is called right after creation only by the same thread and therefore concurrency issues do not occur. |
void |
dispose()
Disposes this SharedItemStateManager and frees resources. |
void |
dump(PrintStream ps)
Dumps the state of this instance in a human readable format for diagnostic purposes. |
ItemState |
getItemState(ItemId id)
Return an item state, given its item id. |
NodeReferences |
getNodeReferences(NodeReferencesId id)
Return a node references object, given its target id |
boolean |
hasItemState(ItemId id)
Return a flag indicating whether an item state for a given item id exists. |
boolean |
hasNodeReferences(NodeReferencesId id)
Return a flag indicating whether a node references object for a given target id exists. |
void |
stateCreated(ItemState created)
Called when an ItemState has successfully
been created (i.e. its underlying persistent state was created). |
void |
stateDestroyed(ItemState destroyed)
Called when an ItemState has successfully been
removed (i.e. its underlying persistent state has been destroyed). |
void |
stateDiscarded(ItemState discarded)
Called when an ItemState has been discarded (i.e. it has
been rendered 'invalid'). |
void |
stateModified(ItemState modified)
Called when an ItemState has successfully
been modified (i.e. its underlying persistent state has changed). |
void |
store(ChangeLog local,
ObservationManagerImpl obsMgr)
Store modifications registered in a ChangeLog . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SharedItemStateManager(PersistenceManager persistMgr, String rootNodeUUID, NodeTypeRegistry ntReg) throws ItemStateException
SharedItemStateManager
instance.
persistMgr
- rootNodeUUID
- ntReg
- Method Detail |
public ItemState getItemState(ItemId id) throws NoSuchItemStateException, ItemStateException
getItemState
in interface ItemStateManager
id
- item id
NoSuchItemStateException
- if the item does not exist
ItemStateException
- if an error occurspublic boolean hasItemState(ItemId id)
hasItemState
in interface ItemStateManager
id
- item id
true
if an item state exists,
otherwise false
public NodeReferences getNodeReferences(NodeReferencesId id) throws NoSuchItemStateException, ItemStateException
getNodeReferences
in interface ItemStateManager
id
- target id
NoSuchItemStateException
- if the item does not exist
ItemStateException
- if an error occurspublic boolean hasNodeReferences(NodeReferencesId id)
hasNodeReferences
in interface ItemStateManager
id
- target id
true
if an item state exists,
otherwise false
public void stateCreated(ItemState created)
ItemState
has successfully
been created (i.e. its underlying persistent state was created).
stateCreated
in interface ItemStateListener
created
- the ItemState
that has been 'created'public void stateModified(ItemState modified)
ItemState
has successfully
been modified (i.e. its underlying persistent state has changed).
stateModified
in interface ItemStateListener
modified
- the ItemState
that has been 'modified'public void stateDestroyed(ItemState destroyed)
ItemState
has successfully been
removed (i.e. its underlying persistent state has been destroyed).
stateDestroyed
in interface ItemStateListener
destroyed
- the ItemState
that has been 'destroyed'public void stateDiscarded(ItemState discarded)
ItemState
has been discarded (i.e. it has
been rendered 'invalid').
stateDiscarded
in interface ItemStateListener
discarded
- the ItemState
that has been discardedItemState.discard()
public void dump(PrintStream ps)
dump
in interface Dumpable
ps
- stream to dump state topublic void dispose()
SharedItemStateManager
and frees resources.
public void addVirtualItemStateProvider(VirtualItemStateProvider prov)
prov
- public void store(ChangeLog local, ObservationManagerImpl obsMgr) throws StaleItemStateException, ItemStateException
ChangeLog
. The items
contained in the ChangeLog are not states returned by this
item state manager but rather must be reconnected to items provided
by this state manager.
After successfully storing the states the observation manager is informed
about the changes, if an observation manager is passed to this method.
NOTE: This method is not synchronized, because all methods it invokes
on instance members (such as PersistenceManager.store(org.apache.jackrabbit.core.state.ChangeLog)
are
considered to be thread-safe. Should this ever change, the
synchronization status has to be re-examined.
local
- change log containing local itemsobsMgr
- the observation manager to inform, or null
if
no observation manager should be informed.
StaleItemStateException
- if at least one of the affected item
states has become stale
ItemStateException
- if another error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |