- @ExceptionHandled
- @Interceptor
- public class ExceptionHandlerInterceptor implements Serializable
- {
- private static final long serialVersionUID = 1L;
- @Inject
- BeanManager beanManager;
- @AroundInvoke
- public Object manage(InvocationContext ic) throws Exception
- {
- try
- {
- return ic.proceed();
- }
- catch (Exception e)
- {
- beanManager.fireEvent(new ExceptionToCatch(e));
- return null;
- }
- }
- }