[infinispan-issues] [JBoss JIRA] (ISPN-9211) CacheListener must be annotated with org.infinispan.notifications.Listener

Diego Lovison (JIRA) issues at jboss.org
Tue Jun 12 10:48:00 EDT 2018


     [ https://issues.jboss.org/browse/ISPN-9211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Diego Lovison closed ISPN-9211.
-------------------------------
    Resolution: Rejected


We need to register via RemoteCache.addClientListener and not Cache.addListener
I will perform more test in this issue and reopen if needed.

> CacheListener must be annotated with org.infinispan.notifications.Listener
> --------------------------------------------------------------------------
>
>                 Key: ISPN-9211
>                 URL: https://issues.jboss.org/browse/ISPN-9211
>             Project: Infinispan
>          Issue Type: Bug
>            Reporter: Diego Lovison
>
> Why I need to add @Listener in the following java class?
> @ClientListener is a listener.
> It seems redundant 
> {code:java}
> @ClientListener
> public class CacheListener {
>    @CacheEntryCreated
>    public void entryCreated(CacheEntryCreatedEvent<String, LocationWeather> event) {
>       if (!event.isOriginLocal()) {
>          System.out.printf("-- Entry for %s modified by another node in the cluster\n", event.getKey());
>       }
>    }
> }
> {code}
> Without the @Listener annotation it will fail with the following error:
> {noformat}
> Exception in thread "main" org.infinispan.notifications.IncorrectListenerException: Cache listener class com.github.diegolovison.example.infinispan.listener.CacheListener must be annotated with org.infinispan.notifications.Listener
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the infinispan-issues mailing list