public class CacheInvalidationFilter extends Object implements DataChannelFilter
DataChannelFilter that invalidates cache groups defined for mapped entities
via CacheGroups annotations.| Constructor and Description |
|---|
CacheInvalidationFilter() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
init(DataChannel channel) |
QueryResponse |
onQuery(ObjectContext originatingContext,
Query query,
DataChannelFilterChain filterChain) |
GraphDiff |
onSync(ObjectContext originatingContext,
GraphDiff changes,
int syncType,
DataChannelFilterChain filterChain) |
protected void |
preCommit(Object object)
A callback method that records cache group to flush at the end of the commit.
|
public void init(DataChannel channel)
init in interface DataChannelFilterpublic QueryResponse onQuery(ObjectContext originatingContext, Query query, DataChannelFilterChain filterChain)
onQuery in interface DataChannelFilterpublic GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, int syncType, DataChannelFilterChain filterChain)
onSync in interface DataChannelFilter@PrePersist(entityAnnotations=CacheGroups.class) @PreRemove(entityAnnotations=CacheGroups.class) @PreUpdate(entityAnnotations=CacheGroups.class) protected void preCommit(Object object)
protected void addCacheGroups(Set<String> groupSet, Object object)
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–2014 Apache Cayenne. All rights reserved.