public static void main(String[] args) {
Configuration configuration = new ConfigurationBuilder().clustering().cacheMode(CacheMode.LOCAL).build();
DefaultCacheManager cacheManager = new DefaultCacheManager();
String newCacheName = "repl";
cacheManager.defineConfiguration(newCacheName, configuration);
Cache<String, String> cache = cacheManager.getCache(newCacheName);
AdvancedCache advancedCache = cache.getAdvancedCache();
advancedCache.withFlags(Flag.SKIP_REMOTE_LOOKUP, Flag.SKIP_CACHE_LOAD).put("local", "only");
advancedCache.addInterceptor(new CustomCommandInterceptor(), 0);
System.out.println(advancedCache.getName());