T result;
InvocationHandler ih = new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
SQLTraceRecord record = new SQLTraceRecord();
record.setMethodName(method.getName());
record.setParams(args);
record.setClassName(actualObject.getClass().getName());
record.setThreadName(Thread.currentThread().getName());
record.setThreadID(Thread.currentThread().getId());
record.setTimeStamp(System.currentTimeMillis());
sqlTraceDelegator.sqlTrace(record);
return method.invoke(actualObject, args);
}
};
result = (T) Proxy.newProxyInstance(actualObject.getClass().getClassLoader(), ifaces, ih);