View Javadoc

1   package com.atlassian.util.profiling.object;
2   
3   import java.io.Serializable;
4   import java.lang.reflect.InvocationHandler;
5   import java.lang.reflect.Method;
6   
7   public class TimerInvocationHandler implements InvocationHandler, Serializable {
8       protected Object target;
9   
10      public TimerInvocationHandler(Object target) {
11          if (target == null)
12              throw new IllegalArgumentException("Target Object passed to timer cannot be null");
13          this.target = target;
14      }
15  
16      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
17          return ObjectProfiler.profiledInvoke(method, target, args);
18      }
19  
20  }