]
Manik Surtani commented on ISPN-735:
------------------------------------
Or feel free to improve the wiki based documentation. :)
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: