ehcache / ehcache3

Ehcache 3.x line
http://www.ehcache.org
Apache License 2.0
2.02k stars 580 forks source link

JCache Listeners can't listen on EVICTED events #3237

Open SamuelBussmann opened 4 months ago

SamuelBussmann commented 4 months ago

When using the JCache API, there is no JCache-event to register a listener for EVICTED events. The JCache spec is undefined regarding the notification on evictions, while requiring notifications on expiry. According to this ehCache only implements the required events (EventListenerAdaptors.ehListenersFor).

Some other JCache implementations seem to have discussed/implemented delegating internal EVICTED event onto EXPIRED or REMOVED listeners.

Currently we need to unwrap the JCache to be able to directly add an ehCache-Eviction-Listener. This is cumbersome and kind of pollutes the JCache-API handling.

Has this topic already been discussed or is there a possibility to add Eviction-listener events through the JCache API to get notified about all? Possibly though the configuration.xml?