此内容没有您所选择的语言版本。
17.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:
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);