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