List of usage examples for com.google.common.cache RemovalNotification toString
@Override
public String toString()
{key}={value}. From source file:com.heliosapm.jmx.cache.CacheStatistics.java
/** * {@inheritDoc}/* ww w . j a v a2s .c o m*/ * @see com.google.common.cache.RemovalListener#onRemoval(com.google.common.cache.RemovalNotification) */ @Override public void onRemoval(RemovalNotification<Object, Object> removal) { final Notification notif = new Notification("cache.removal", objectName, sequence.incrementAndGet(), System.currentTimeMillis(), "Cache entry [" + removal.toString() + "] removed from cache [" + cacheName + "]. Cause:" + removal.getCause().name()); final JSONObject json = new JSONObject(); json.put("event", "cache.removal"); json.put("cacheName", cacheName); json.put("key", removal.getKey()); json.put("value", removal.getValue()); json.put("cause", removal.getCause().name()); notif.setUserData(json.toString()); sendNotification(notif); }