• Bug
  • Status: Closed
  • 3 Minor
  • Resolution: Fixed
  • Documentation,ehcache
  • Reporter: sourceforgetracker
  • September 21, 2009
  • 0
  • Watchers: 0
  • March 15, 2011
  • October 12, 2010

Description

Could you please provide a way to add programmaticaly a listener on an instance of a cache ? I would like to be able to write something like this :

existingCache.addCacheEventListener(myListenerClass); Sourceforge Ticket ID: 1721260 - Opened By: djeanprost - 18 May 2007 11:56 UTC

Comments

Fiona OShea 2009-09-22

Re-opening so that I can properly close out these issues and have correct Resolution status in Jira

orion 2010-09-13

This turns out to be pretty hard to do. Here’s a way to do it (to a cache that is already part of a CacheManager):

cache.getCacheEventNotificationService().getCacheEventListeners().add(myListener);

Doing it through configuration is even weirder and should be something along the lines of:

cache.getCacheConfiguration().addCacheEventListenerFactory(myFactory);

where factory is something I’m able to define.

In any case, it should be documented here: http://ehcache.org/documentation/cache_event_listeners.html

gluck 2010-10-12

This funtionality is there but not documented.

documented in an FAQ entry.

Kalai Kannaiyan 2011-03-15

Verified in the doc, http://ehcache.org/documentation/cache_event_listeners.html