This content has been marked as final.
Show 2 replies
-
1. Re: Can not get the value of cache entry when CacheEntryCreated Event notified
ksuzumur Jul 4, 2012 4:20 AM (in response to fangyuchen)When it's first call, I think it is not a bug. Could you call the event twice? The Document describes this resason. I will try looking for it.
-
2. Re: Can not get the value of cache entry when CacheEntryCreated Event notified
dan.berindei Jul 5, 2012 2:07 AM (in response to ksuzumur)This is intentional (although probably not very clear in the javadoc).
You can register a CacheEntryModified listener instead, it will be called on creation as well as on modification: http://docs.jboss.org/infinispan/5.1/apidocs/org/infinispan/notifications/cachelistener/event/CacheEntryModifiedEvent.html
It is a little hard to see if the entry was created or modified though, you need to check if the value is null when isPre()==true, but you can only access the actual value when isPre()==false.