Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 26th, 2011  |  syntax: None  |  size: 0.47 KB  |  views: 54  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. @ExceptionHandled
  2. @Interceptor
  3. public class ExceptionHandlerInterceptor implements Serializable
  4. {
  5.    private static final long serialVersionUID = 1L;
  6.  
  7.    @Inject
  8.    BeanManager beanManager;
  9.  
  10.    @AroundInvoke
  11.    public Object manage(InvocationContext ic) throws Exception
  12.    {
  13.       try
  14.       {
  15.          return ic.proceed();
  16.       }
  17.       catch (Exception e)
  18.       {
  19.          beanManager.fireEvent(new ExceptionToCatch(e));
  20.          return null;
  21.       }
  22.    }
  23.  
  24. }
  25.  
clone this paste RAW Paste Data