[infinispan-issues] [JBoss JIRA] (ISPN-3539) Allow adding multiple custom interceptors without calling customInterceptors() every time

Tristan Tarrant (JIRA) issues at jboss.org
Mon Jan 12 09:17:25 EST 2015


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

Tristan Tarrant reassigned ISPN-3539:
-------------------------------------

    Assignee:     (was: Mircea Markus)


> Allow adding multiple custom interceptors without calling customInterceptors() every time
> -----------------------------------------------------------------------------------------
>
>                 Key: ISPN-3539
>                 URL: https://issues.jboss.org/browse/ISPN-3539
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: Core
>            Reporter: Jiří Holuša
>            Priority: Minor
>
> When adding multiple custom interceptors programmatically via ConfigurationBuilder, you have to call customInterceptors() every time you want to add a new one. 
> The code than looks like this:
> {code:borderStyle=solid}
> Configuration c2 = new ConfigurationBuilder()
>             .customInterceptors()
>                .addInterceptor()
>                   .position(InterceptorConfiguration.Position.FIRST).interceptor(new FirstInterceptor(1))
>             .customInterceptors()
>                .addInterceptor()
>                   .after(FirstInterceptor.class).interceptor(new SecondInterceptor(2))
>             .build();
> {code}
> I think this is very ugly and it would be nice and even semantically more meaningful to do it like:
> {code:borderStyle=solid}
> Configuration c2 = new ConfigurationBuilder()
>             .customInterceptors()
>                .addInterceptor()
>                   .position(InterceptorConfiguration.Position.FIRST).interceptor(new FirstInterceptor(1))            
>                .addInterceptor()
>                   .after(FirstInterceptor.class).interceptor(new SecondInterceptor(2))
>             .build();
> {code}
> e.g. calling customInterceptors() only once.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)



More information about the infinispan-issues mailing list