[infinispan-dev] singleton @Listeners

Galder Zamarreño galder at redhat.com
Thu Jul 5 21:46:20 EDT 2012


On Jun 28, 2012, at 11:26 AM, Mircea Markus wrote:

> This is a problem that pops up constantly: 
> User:      "I add a listener to my distributed/replicated cache but this gets invoked numOwners times - can I make that to be invoked only once cluster wise?" 
> Developer: "Yes, you can! You have to do that and that..."
> 
> What about a "singleton" attribute on the Listener? Would make the reply shorter:
> Developer: "Use @Listener(singleton=true)"

Hmmm, that seems doable without any extra attributes.

For a replicated cache, take the view and pick a node (consistently)

For a distributed cache, find the primary owner of a key.

Has this been asked so often? I don't recall right now… :)

> 
> Cheers,
> Mircea
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache




More information about the infinispan-dev mailing list