Class CacheInvalidationFilter
- java.lang.Object
-
- org.apache.cayenne.cache.invalidation.CacheInvalidationFilter
-
- All Implemented Interfaces:
DataChannelSyncFilter
public class CacheInvalidationFilter extends Object implements DataChannelSyncFilter
A
DataChannelSyncFilterthat invalidates cache groups. Use custom rules for invalidation provided via DI.Default rule is based on entities'
CacheGroupsannotation.To add default filter:
ServerRuntime.builder("cayenne-project.xml") .addModule(CacheInvalidationModuleBuilder.builder().build());- Since:
- 4.0 enhanced to support custom handlers.
- See Also:
CacheInvalidationModuleExtender,InvalidationHandler
-
-
Constructor Summary
Constructors Constructor Description CacheInvalidationFilter(org.apache.cayenne.di.Provider<QueryCache> cacheProvider, List<InvalidationHandler> handlers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<CacheGroupDescriptor>getOrCreateTxGroups()GraphDiffonSync(ObjectContext originatingContext, GraphDiff changes, int syncType, DataChannelSyncFilterChain filterChain)protected voidpreCommit(Object object)A callback method that records cache group to flush at the end of the commit.
-
-
-
Constructor Detail
-
CacheInvalidationFilter
public CacheInvalidationFilter(org.apache.cayenne.di.Provider<QueryCache> cacheProvider, List<InvalidationHandler> handlers)
-
-
Method Detail
-
onSync
public GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, int syncType, DataChannelSyncFilterChain filterChain)
- Specified by:
onSyncin interfaceDataChannelSyncFilter
-
preCommit
@PrePersist @PreRemove @PreUpdate protected void preCommit(Object object)
A callback method that records cache group to flush at the end of the commit.
-
getOrCreateTxGroups
protected Set<CacheGroupDescriptor> getOrCreateTxGroups()
-
-