[infinispan-issues] [JBoss JIRA] Commented: (ISPN-735) Bug in the cache event notifications {CacheStarted, CacheStopped, ViewChanged}

Manik Surtani (JIRA) jira-events at lists.jboss.org
Tue Oct 26 03:37:54 EDT 2010


    [ https://jira.jboss.org/browse/ISPN-735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559211#action_12559211 ] 

Manik Surtani 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?

> 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/Listener.html
> 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

        


More information about the infinispan-issues mailing list