[infinispan-dev] Translating our events to JSR 107 events

Vladimir Blagojevic vblagoje at redhat.com
Fri Jan 25 16:25:42 EST 2013


Hey,

I figured out why cache listeners notifications were not fired. We have 
to add listener *after* cache.start() has been called. If listener is 
added before start it will not be registered.

That aside I found some problems mapping our events to jsr 107 events. 
The problem is specifically with JSR107 CacheEntryCreatedListener and 
CacheEntryExpiredListener.

The first one is not easy to implement because we need both key/value 
pair for jsr listener and our CacheEntryCreatedEvent does not provide 
value. I found some references where people used CacheEntryModified 
instead with pre being null and post being value to detect new entry in 
cache. In that case listener translator class would have to keep state 
and track pre(true/false) for CacheEntryModified, right? Any other way 
to do it?

The second I have no idea how to implement as we do not have 
CacheEntryExpired event. True, spec is not rigorous that such an event 
has to be fired immediately after an entry has expired but eventually 
(which might be on access). Either way, I am all ears on suggestions how 
to implement this one.

Regards,
Vladimir







More information about the infinispan-dev mailing list