org.modeshape.jcr.cache
Interface SessionCache.PreSave
- All Known Implementing Classes:
- JcrSession.JcrPreSave
- Enclosing interface:
- SessionCache
public static interface SessionCache.PreSave
The definition of a callback that can be implemented and passed to 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.
process
void process(MutableCachedNode modifiedOrNewNode,
SessionCache.SaveContext context)
throws Exception
- Process the supplied node prior to saving the changes. This allows implementations to use the changes to automatically
adjust this node or other content.
- Parameters:
modifiedOrNewNode
- the mutable node that was changed in this session; never nullcontext
- the context of the save operation; never null
- Throws:
Exception
- if there is a problem during the processing
Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.