コード例 #1
0
 private void initNearCache() {
   NearCacheConfig nearCacheConfig = clientContext.getClientConfig().getNearCacheConfig(name);
   if (nearCacheConfig != null) {
     cacheOnUpdate =
         nearCacheConfig.getLocalUpdatePolicy() == NearCacheConfig.LocalUpdatePolicy.CACHE;
     NearCacheContext nearCacheContext =
         new NearCacheContext(
             nearCacheManager,
             clientContext.getSerializationService(),
             createNearCacheExecutor(clientContext.getExecutionService()));
     nearCache =
         nearCacheManager.getOrCreateNearCache(nameWithPrefix, nearCacheConfig, nearCacheContext);
     registerInvalidationListener();
   }
 }
コード例 #2
0
 protected NearCache createNearCache(NearCacheManager nearCacheManager, String name) {
   return nearCacheManager.getOrCreateNearCache(
       name,
       createNearCacheConfig(DEFAULT_NEAR_CACHE_NAME, NearCacheConfig.DEFAULT_MEMORY_FORMAT),
       createNearCacheContext());
 }