Class CacheDispatcherImpl

  • All Implemented Interfaces:
    CacheDispatcher

    @Component
    public class CacheDispatcherImpl
    extends Object
    implements CacheDispatcher
    Dispatches cache-related events - mainly invalidation ones - to all relevant listeners: CacheRegistry (grouping local caches) and ClusterCacheListener (for inter-node distribution).

    Could be reworked in the future.

    Note that this class resides in repo-cache module almost by accident and perhaps should be moved to a more appropriate place.

    • Constructor Detail

      • CacheDispatcherImpl

        public CacheDispatcherImpl()
    • Method Detail

      • dispatchInvalidation

        public <O extends ObjectType> void dispatchInvalidation​(Class<O> type,
                                                                String oid,
                                                                boolean clusterwide,
                                                                @Nullable
                                                                @Nullable CacheInvalidationContext context)
        Description copied from interface: CacheDispatcher
        Dispatches "cache entry/entries invalidation" event to all relevant caches, even clusterwide if requested so.
        Specified by:
        dispatchInvalidation in interface CacheDispatcher
        Parameters:
        type - Type of object(s) to be invalidated. Null means 'all types' (implies oid is null as well).
        oid - Object(s) to be invalidated. Null means 'all objects of given type(s)'.
        clusterwide - True if the event has to be distributed clusterwide.
        context - Context of the invalidation request (optional).