Skip to content

Instantly share code, notes, and snippets.

@galderz
Created August 20, 2014 14:16
Show Gist options
  • Select an option

  • Save galderz/2aa09739dac717e50311 to your computer and use it in GitHub Desktop.

Select an option

Save galderz/2aa09739dac717e50311 to your computer and use it in GitHub Desktop.
import org.infinispan.client.hotrod.*;
RemoteCacheManager rcm = new RemoteCacheManager();
RemoteCache<Integer, String> cache = rcm.getCache();
BasicFilteredEventLogListener listener = new BasicFilteredEventLogListener();
try {
cache.addClientListener(listener);
cache.putIfAbsent(1, "one");
cache.replace(1, "new-one");
cache.putIfAbsent(2, "two");
cache.replace(2, "new-two");
cache.putIfAbsent(3, "three");
cache.replace(3, "new-three");
cache.remove(1);
cache.remove(2);
cache.remove(3);
} finally {
cache.removeClientListener(listener);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment