Example #1
0
  @Override
  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    Object res = null;

    {
      long t0 = System.nanoTime();

      try {
        res = method.invoke(resource, args);
      } catch (InvocationTargetException ex) {
        throw ex.getTargetException();
      } catch (Exception ex) {
        throw ex;
      } finally {
        long t1 = System.nanoTime();
        long t = t1 - t0;

        log(method, args, t);
      }
    }

    return res;
  }