Esempio n. 1
0
 public void publish(String key, String value) {
   logger.log(Level.INFO, "adding cache entry: " + key + " = " + value);
   try {
     if (cache == null) {
       cache = gms.getGroupHandle().getDistributedStateCache();
     }
     cache.addToCache(GROUP_NAME, gms.getInstanceName(), key, value);
     GroupHandle gh = gms.getGroupHandle();
     gh.sendMessage(CACHE_CHANGE, CACHE_CHANGE.getBytes());
   } catch (GMSException e) {
     logger.log(Level.SEVERE, "Error updating cache" + e);
   }
 }
Esempio n. 2
0
 public Map getCache() {
   if (cache == null) {
     cache = gms.getGroupHandle().getDistributedStateCache();
   }
   return cache.getAllCache();
 }