]
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}