-
1. Re: How to achieve PostProcess interceptor using CDI Weld
jharting Jan 2, 2015 3:48 AM (in response to arungujjartest)I do not understand the difference between what you got and what you want to achieve. Can you elaborate?
-
2. Re: How to achieve PostProcess interceptor using CDI Weld
arungujjartest Jan 8, 2015 2:04 PM (in response to jharting)Hi Jozef,
Basically I need to know if we can have a interceptor which intercepts after the transaction is completed but before it responds back to the calling component. We can do this in RESTEasy implementing PostProcessorInterceptor but how to achieve the same using CDI Weld 2.2.7 version.
Regards,
Arun
-
3. Re: How to achieve PostProcess interceptor using CDI Weld
swdev Jan 9, 2015 1:22 PM (in response to arungujjartest)CDI interceptor supports running code before & after the intercepted method, that should do what you need.
-
4. Re: How to achieve PostProcess interceptor using CDI Weld
arungujjartest Jan 10, 2015 6:04 PM (in response to swdev)Hi Tony, could you please help with code snippet to invoke after intercepted method?
Regards,
Arun
-
5. Re: How to achieve PostProcess interceptor using CDI Weld
mkouba Jan 12, 2015 10:36 AM (in response to arungujjartest)Hi Arun,
I'm not sure what "transaction" are you talking about. However, I suppose you just want to execute some code after the intercepted method finished. And that's fairly easy. Just invoke InvocationContext.proceed(), store the returned Object, do something and finally return the stored Object. See for example this TCK test: https://github.com/cdi-spec/cdi-tck/blob/master/impl/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/BazInterceptor.java