public static interface SessionCache.PreSave
SessionCache.save(SessionCache, PreSave)
and
SessionCache.save(Set, SessionCache, PreSave)
, allowing the caller to recieve a hook where they can interrogate
each of the changed nodes and perform additional logic prior to the actual persisting of the changes. Note that
implementations are free to make additional modifications to the supplied nodes, and even create additional nodes or change
persistent but unchanged nodes, as long as these operations are done within the same calling thread.Modifier and Type | Method and Description |
---|---|
void |
process(MutableCachedNode modifiedOrNewNode,
SessionCache.SaveContext context)
Process the supplied node prior to saving the changes.
|
void |
processAfterLocking(MutableCachedNode modifiedNode,
SessionCache.SaveContext context,
NodeCache persistentNodeCache)
Process the supplied existing node prior to saving the changes but only after the entry corresponding to the key of the
node has been locked in Infinispan.
|
void process(MutableCachedNode modifiedOrNewNode, SessionCache.SaveContext context) throws Exception
modifiedOrNewNode
- the mutable node that was changed in this session; never nullcontext
- the context of the save operation; never nullException
- if there is a problem during the processingvoid processAfterLocking(MutableCachedNode modifiedNode, SessionCache.SaveContext context, NodeCache persistentNodeCache) throws Exception
LockingMode.PESSIMISTIC
flag is enabled. This method should be implemented as
optimal as possible and should only be needed in multi-threaded scenarios where concurrent modifications may break
consistency.modifiedNode
- the mutable node that was changed in this session; never nullcontext
- the context of the save operation; never nullpersistentNodeCache
- the node cache from which the persistent representation of the nodes can be obtained; never
nullException
- if there is a problem during the processingCopyright © 2008-2015 JBoss, a division of Red Hat. All Rights Reserved.