Skip to content

Instantly share code, notes, and snippets.

@jcrossley3
Created May 19, 2014 16:01
Show Gist options
  • Save jcrossley3/1d30b409df7bea307174 to your computer and use it in GitHub Desktop.
Save jcrossley3/1d30b409df7bea307174 to your computer and use it in GitHub Desktop.
(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