[infinispan-dev] Feedback and requests on clustered and remote listeners

Mircea Markus mmarkus at redhat.com
Tue Sep 23 10:42:22 EDT 2014


On Sep 23, 2014, at 16:59, Emmanuel Bernard <emmanuel at hibernate.org> wrote:

>> Reread the other email again and actually it could be used to show
>> different permutations like the retry case (eq RETRIED_CREATE), but it
>> seems like the code in that one method would get pretty complex pretty
>> fast having to handle all the various cases.
> 
> If the combiname becomes complicated for a specific complex filter, nothing prevents the implementor to split it into different methods
> 
> public boolean filter(Key key, Value old, Value new, EventType eventType, Metadata metadata) {
>     switch(eventType) {
>         case CREATE:
>             return filterForCreate(…);
>             break;
>         ….
>         default:
>             throw new AssertionFailure(“oops: “ + eventType);
>     }
> }
> 
> private boolean filterForCreate(…) {
>     ….
> }

We can provide this as a default abstract impl for the Functional interface
Cheers,
-- 
Mircea Markus
Infinispan lead (www.infinispan.org)







More information about the infinispan-dev mailing list