Created
May 19, 2014 16:01
-
-
Save jcrossley3/1d30b409df7bea307174 to your computer and use it in GitHub Desktop.
This file contains 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
(ns my.cache.listener | |
(:require [immutant.cache :as c]) | |
(:import org.infinispan.notifications.Listener | |
[org.infinispan.notifications.cachelistener.annotation | |
CacheEntryCreated CacheEntryModified CacheEntryRemoved])) | |
(definterface Handler (^void handle [event])) | |
(deftype ^{Listener true} | |
Monitor [] | |
Handler (^{:tag void | |
CacheEntryCreated true | |
CacheEntryModified true | |
CacheEntryRemoved true} | |
handle [this event] (prn event))) | |
(def foo (c/create "foo")) | |
(.addListener (.cache foo) (Monitor.)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment