org.apache.cayenne.lifecycle.cache
Class CacheInvalidationFilter
java.lang.Object
org.apache.cayenne.lifecycle.cache.CacheInvalidationFilter
- All Implemented Interfaces:
- DataChannelFilter
public class CacheInvalidationFilter
- extends Object
- implements DataChannelFilter
A DataChannelFilter that invalidates cache groups defined for mapped entities
via CacheGroups annotations.
- Since:
- 3.1
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CacheInvalidationFilter
public CacheInvalidationFilter()
init
public void init(DataChannel channel)
- Specified by:
init in interface DataChannelFilter
onQuery
public QueryResponse onQuery(ObjectContext originatingContext,
Query query,
DataChannelFilterChain filterChain)
- Specified by:
onQuery in interface DataChannelFilter
onSync
public GraphDiff onSync(ObjectContext originatingContext,
GraphDiff changes,
int syncType,
DataChannelFilterChain filterChain)
- Specified by:
onSync in interface DataChannelFilter
preCommit
@PrePersist(entityAnnotations=CacheGroups.class)
@PreRemove(entityAnnotations=CacheGroups.class)
@PreUpdate(entityAnnotations=CacheGroups.class)
protected void preCommit(Object object)
- A callback method that records cache group to flush at the end of the commit.
addCacheGroups
protected void addCacheGroups(Set<String> groupSet,
Object object)
- A method that builds a list of cache groups for a given object and adds them to the
invalidation group set. This implementation adds all groups defined via
CacheGroups annotation for a given class. Subclasses may override this
method to provide more fine-grained filtering of cache groups to invalidate, based
on the state of the object.
Copyright © 2001-2013 Apache Cayenne. All Rights Reserved.