Created
August 20, 2014 14:16
-
-
Save galderz/2aa09739dac717e50311 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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