Class InvalidationInterceptor

All Implemented Interfaces:
Visitor, AsyncInterceptor, JmxStatisticsExposer

@MBean(objectName="Invalidation", description="Component responsible for invalidating entries on remote caches when entries are written to locally.") public class InvalidationInterceptor extends BaseRpcInterceptor implements JmxStatisticsExposer
This interceptor acts as a replacement to the replication interceptor when the CacheImpl is configured with ClusteredSyncMode as INVALIDATE.

The idea is that rather than replicating changes to all caches in a cluster when write methods are called, simply broadcast an InvalidateCommand on the remote caches containing all keys modified. This allows the remote cache to look up the value in a shared cache loader which would have been updated with the changes.

Transactional caches, still lock affected keys on the primary owner:

  • Pessimistic caches acquire locks with an explicit lock command and release during the one-phase PrepareCommand.
  • Optimistic caches acquire locks during the 2-phase prepare command and release locks with a TxCompletionNotificationCommand.

Since:
9.0
Author:
Manik Surtani, Galder ZamarreƱo, Mircea.Markus@jboss.com