示例#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);
   }
 }
示例#2
0
 public List<String> getAgent() {
   return gms.getGroupHandle().getAllCurrentMembers();
 }
示例#3
0
 public Map getCache() {
   if (cache == null) {
     cache = gms.getGroupHandle().getDistributedStateCache();
   }
   return cache.getAllCache();
 }