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