|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.state.LocalItemStateManager
org.apache.jackrabbit.core.state.XAItemStateManager
public class XAItemStateManager
Extension to LocalItemStateManager
that remembers changes on
multiple save() requests and commits them only when an associated transaction
is itself committed.
Field Summary |
---|
Fields inherited from class org.apache.jackrabbit.core.state.LocalItemStateManager |
---|
factory, sharedStateMgr |
Constructor Summary | |
---|---|
XAItemStateManager(SharedItemStateManager sharedStateMgr,
EventStateCollectionFactory factory,
ItemStateCacheFactory cacheFactory)
Creates a new instance of this class. |
|
XAItemStateManager(SharedItemStateManager sharedStateMgr,
EventStateCollectionFactory factory,
String attributeName,
ItemStateCacheFactory cacheFactory)
Creates a new instance of this class with a custom attribute name. |
Method Summary | |
---|---|
void |
afterOperation(TransactionContext tx)
Invoked after one of the InternalXAResource.prepare(org.apache.jackrabbit.core.TransactionContext) , InternalXAResource.commit(org.apache.jackrabbit.core.TransactionContext) or
InternalXAResource.rollback(org.apache.jackrabbit.core.TransactionContext) method has been called. |
void |
associate(TransactionContext tx)
Associate this resource with a transaction. |
void |
beforeOperation(TransactionContext tx)
Invoked before one of the InternalXAResource.prepare(org.apache.jackrabbit.core.TransactionContext) , InternalXAResource.commit(org.apache.jackrabbit.core.TransactionContext) or
InternalXAResource.rollback(org.apache.jackrabbit.core.TransactionContext) method is called. |
void |
commit(TransactionContext tx)
Commit transaction. |
ChangeLog |
getChangeLog()
Returns the current change log. |
protected ChangeLog |
getChanges()
Returns the change log that contains the current changes in this local item state manager. |
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 |
prepare(TransactionContext tx)
Prepare transaction. |
void |
rollback(TransactionContext tx)
Rollback transaction. |
void |
setVirtualProvider(VirtualItemStateProvider virtualProvider)
Set optional virtual item state provider. |
protected void |
update(ChangeLog changeLog)
End an update operation. |
Methods inherited from class org.apache.jackrabbit.core.state.LocalItemStateManager |
---|
addListener, cancel, createNew, createNew, destroy, dispose, edit, getNodeState, getPropertyState, inEditMode, nodeAdded, nodeModified, nodeRemoved, nodesReplaced, removeListener, stateCreated, stateDestroyed, stateDiscarded, stateModified, store, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XAItemStateManager(SharedItemStateManager sharedStateMgr, EventStateCollectionFactory factory, ItemStateCacheFactory cacheFactory)
sharedStateMgr
- shared state managerfactory
- event state collection factorypublic XAItemStateManager(SharedItemStateManager sharedStateMgr, EventStateCollectionFactory factory, String attributeName, ItemStateCacheFactory cacheFactory)
sharedStateMgr
- shared state managerfactory
- event state collection factoryattributeName
- attribute nameMethod Detail |
---|
public void setVirtualProvider(VirtualItemStateProvider virtualProvider)
public void associate(TransactionContext tx)
associate
in interface InternalXAResource
tx
- transaction context, if null
disassociatepublic void beforeOperation(TransactionContext tx)
InternalXAResource.prepare(org.apache.jackrabbit.core.TransactionContext)
, InternalXAResource.commit(org.apache.jackrabbit.core.TransactionContext)
or
InternalXAResource.rollback(org.apache.jackrabbit.core.TransactionContext)
method is called.
beforeOperation
in interface InternalXAResource
tx
- transaction contextpublic void prepare(TransactionContext tx) throws TransactionException
prepare
in interface InternalXAResource
tx
- transaction context
TransactionException
- if an error occurspublic void commit(TransactionContext tx) throws TransactionException
commit
in interface InternalXAResource
tx
- transaction context
TransactionException
- if an error occurspublic void rollback(TransactionContext tx)
rollback
in interface InternalXAResource
tx
- transaction context.public void afterOperation(TransactionContext tx)
InternalXAResource.prepare(org.apache.jackrabbit.core.TransactionContext)
, InternalXAResource.commit(org.apache.jackrabbit.core.TransactionContext)
or
InternalXAResource.rollback(org.apache.jackrabbit.core.TransactionContext)
method has been called.
afterOperation
in interface InternalXAResource
tx
- transaction contextpublic ChangeLog getChangeLog()
null
if no
change log was found.
protected ChangeLog getChanges()
LocalItemStateManager
getChanges
in class LocalItemStateManager
UnsupportedOperationException
- always.public ItemState getItemState(ItemId id) throws NoSuchItemStateException, ItemStateException
getItemState
in interface ItemStateManager
getItemState
in class LocalItemStateManager
id
- item id
NoSuchItemStateException
- if the item does not exist
ItemStateException
- if an error occurspublic boolean hasItemState(ItemId id)
hasItemState
in interface ItemStateManager
hasItemState
in class LocalItemStateManager
id
- item id
true
if an item state exists,
otherwise false
public NodeReferences getNodeReferences(NodeReferencesId id) throws NoSuchItemStateException, ItemStateException
getNodeReferences
in interface ItemStateManager
getNodeReferences
in class LocalItemStateManager
id
- target id
NoSuchItemStateException
- if the item does not exist
ItemStateException
- if an error occurspublic boolean hasNodeReferences(NodeReferencesId id)
hasNodeReferences
in interface ItemStateManager
hasNodeReferences
in class LocalItemStateManager
id
- target id
true
if a node reference object exists for the given
id, otherwise false
.protected void update(ChangeLog changeLog) throws ReferentialIntegrityException, StaleItemStateException, ItemStateException
update
in class LocalItemStateManager
changeLog
- change log containing local states and references
ReferentialIntegrityException
- if a new or modified REFERENCE
property refers to a non-existent
target or if a removed node is still
being referenced
StaleItemStateException
- if at least one of the affected item
states has become stale in the meantime
ItemStateException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |