-
Feature Request
-
Resolution: Done
-
Major
-
3.0.0.Alpha11
-
None
I was thinking that similarly to BeanBuilder we currently have, we could provide a builder for Interceptors. For the interceptor case it would be much simpler since much of the Bean metadata does not make sense for interceptors (e.g. scope, name, alternative, etc.). The usage could look something like this:
.addInterceptor() .interceptingWith(InterceptionType.AROUND_INVOKE, (context) -> { System.out.println("entering " + context.getMethod()); final Object result = context.proceed(); System.out.println("leaving " + context.getMethod()); return result; }) .bindings(Debug.Literal.INSTANCE);
We would probably need some support for state propagation - the sample above is completely stateless.
This is still a very rough idea so any feedback is welcome.
- is related to
-
WELD-2125 Expose InterceptorBuilder in Weld builder
- Resolved