Class CacheInvalidationFilter
java.lang.Object
org.apache.cayenne.cache.invalidation.CacheInvalidationFilter
- All Implemented Interfaces:
DataChannelSyncFilter
A DataChannelSyncFilter that invalidates cache groups.
Use custom rules for invalidation provided via DI.
Default rule is based on entities' CacheGroups annotation.
To add default filter:
ServerRuntime.builder("cayenne-project.xml")
.addModule(CacheInvalidationModuleBuilder.builder().build());
- Since:
- 4.0 enhanced to support custom handlers.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCacheInvalidationFilter(org.apache.cayenne.di.Provider<QueryCache> cacheProvider, List<InvalidationHandler> handlers) -
Method Summary
Modifier and TypeMethodDescriptionprotected Set<CacheGroupDescriptor> onSync(ObjectContext originatingContext, GraphDiff changes, int syncType, DataChannelSyncFilterChain filterChain) protected voidA callback method that records cache group to flush at the end of the commit.
-
Constructor Details
-
CacheInvalidationFilter
public CacheInvalidationFilter(org.apache.cayenne.di.Provider<QueryCache> cacheProvider, List<InvalidationHandler> handlers)
-
-
Method Details
-
onSync
public GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, int syncType, DataChannelSyncFilterChain filterChain) - Specified by:
onSyncin interfaceDataChannelSyncFilter
-
preCommit
A callback method that records cache group to flush at the end of the commit. -
getOrCreateTxGroups
-