[
https://jira.jboss.org/browse/ISPN-735?page=com.atlassian.jira.plugin.sys...
]
Thomas Fuller commented on ISPN-735:
------------------------------------
"Aha, you do realise that listeners with @CacheStopped, @CacheStarted and
@ViewChanged should be registered on the EmbeddedCacheManager and NOT the Cache,
right?"
No I wasn't aware of this -- I'll try this later today and come back to you (if
necessary).
"Have you tried this with 4.2.0.ALPHA4 or 4.2.0-SNAPSHOT?"
I have not -- should I? (given what you said above it may not make sense)
Finally, the documentation for CacheStarted, CacheStopped, and ViewChanged is not explicit
regarding how these annotations should be used. Would it make sense for me to either amend
this defect or add a new low-priority one requesting an update on the documentation for
these annotations?
Thanks for your help,
Tom
Bug in the cache event notifications {CacheStarted, CacheStopped,
ViewChanged}
------------------------------------------------------------------------------
Key: ISPN-735
URL:
https://jira.jboss.org/browse/ISPN-735
Project: Infinispan
Issue Type: Bug
Components: Listeners
Affects Versions: 4.1.0.Final
Reporter: Thomas Fuller
Assignee: Manik Surtani
I am currently working on adding some functionality to the Grails Infinispan Plugin,
which relies on Infinispan-4.1.0.FINAL (Radegast). This particular functionality is
expressed as a mixin and will allow the developer to use a closure to receive event
notifications from the cache -- for example:
agentCache.onCacheEntryLoaded {
log.info ("=====> Cache entry loaded: $it")
}
I have a basic unit test for each of the events detailed in the Listener documentation
here:
http://docs.jboss.org/infinispan/4.0/apidocs/org/infinispan/notifications...
however the following three annotations are not being registered (whereas all the others
are):
import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStarted
import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStopped
import org.infinispan.notifications.cachemanagerlistener.annotation.ViewChanged
Instead I'm receiving a message like the following when my test application starts:
cachelistener.CacheNotifierImpl Attempted to register listener of class class
com.coherentlogic.grails.infinispan.listeners.CacheStoppedListener, but no valid,public
methods annotated with method-level event annotations found! Ignoring listener.
and likewise my unit tests are also failing.
Here's an example of one of the listener implementations which works:
@Listener
class CacheEntryCreatedListener {
private def closure
@CacheEntryCreated
public void cacheEntryCreated (cacheEntryCreatedEvent) {
closure?.call (cacheEntryCreatedEvent)
}
}
Here's an example of one of the listener implementations which does not work:
@Listener
class CacheStoppedListener {
private def closure
@CacheStopped
public void cacheStopped (cacheStoppedEvent) {
closure?.call (cacheStoppedEvent)
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira