Advertisement
TikhomirovSergey

Untitled

Sep 3rd, 2013
1,145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. protected static final class PageInterceptor extends Interceptor {
  2.    
  3.         public PageInterceptor()
  4.         {
  5.             super();
  6.         }
  7.        
  8.         @Override
  9.         public synchronized Object intercept(Object page, Method method, Object[] args, MethodProxy          methodProxy) throws Throwable {
  10.             if (method.isAnnotationPresent(Page.PageMethod.class))
  11.             {   //if there are actions with a page
  12.                 ((Page) page).switchToMe();
  13.             }
  14.             try
  15.             {
  16.                 return methodProxy.invokeSuper(page, args);
  17.             }
  18.             catch (Exception e)
  19.             {
  20.                 return handleException((Page) page, method, methodProxy, args, e);
  21.             }
  22.         }
  23.    
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement