JBoss.org Community Documentation

6.3.1. Interceptors

An Interceptor is an abstract class, several of which comprise an interceptor chain. It exposes an invoke() method, which must be overridden by implementing classes to add behaviour to a call before passing the call down the chain by calling super.invoke() .

SPI Interfaces

Figure 6.3. SPI Interfaces


JBoss Cache ships with several interceptors, representing different configuration options, some of which are:

  • TxInterceptor - looks for ongoing transactions and registers with transaction managers to participate in synchronization events
  • ReplicationInterceptor - replicates state across a cluster using a JGroups channel
  • CacheLoaderInterceptor - loads data from a persistent store if the data requested is not available in memory

The interceptor chain configured for your cache instance can be obtained and inspected by calling CacheSPI.getInterceptorChain() , which returns an ordered List of interceptors.