This document is DEPRECATED.

Please consider any information here as out of date. DO NOT use this document.

Instead, refer to

Please update your bookmarks accordingly.

Skip to end of metadata
Go to start of metadata


It is possible to add custom interceptors to Infinispan, both declaratively and programatically. Custom interceptors are an way of extending Infinispan by being able to influence or respond to any modifications to cache. Example of such modifications are: elements are added/removed/updated or transactions are committed. For a detailed list refer to CommandInterceptor API.

Adding custom interceptors declaratively

Custom interceptors can be added on a per named cache basis. This is because each named cache have it's own interceptor stack. Following xml snippet depicts the ways in which an custom interceptor can be added.

Adding custom interceptors programatically

In order to do that one needs to obtain a reference to the AdvancedCache. This can be done ass follows:

Then one of the addInterceptor() methods should be used to add the actual interceptor. For further documentation refer to AdvancedCache javadoc.

Custom interceptor design

  • Custom interceptors must extend CommandInterceptor
  • Custom interceptors must declare a public, empty constructor to enable construction.
  • Custom  interceptors will have setters for any property defined through property tag.
infinispan infinispan Delete
interceptor interceptor Delete
custom_interceptor custom_interceptor Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.