2.4.4.3.2. Adding Custom Interceptors Programmatically
To add a custom interceptor programmatically in JBoss Data Grid, first obtain a reference to the
AdvancedCache.
For example:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
CacheManager cm = getCacheManager();
Cache aCache = cm.getCache("aName");
AdvancedCache advCache = aCache.getAdvancedCache();
CacheManager cm = getCacheManager();
Cache aCache = cm.getCache("aName");
AdvancedCache advCache = aCache.getAdvancedCache();
Then use an
addInterceptor() method to add the interceptor.
For example:
advCache.addInterceptor(new MyInterceptor(), 0);
advCache.addInterceptor(new MyInterceptor(), 0);