|
|
@@ -17,8 +17,6 @@
|
|
|
package com.jfinal.ext.proxy;
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.Set;
|
|
|
import com.jfinal.aop.Interceptor;
|
|
|
import com.jfinal.aop.InterceptorManager;
|
|
|
import com.jfinal.aop.Invocation;
|
|
|
@@ -30,15 +28,10 @@ import javassist.util.proxy.MethodHandler;
|
|
|
*/
|
|
|
class JavassistCallback implements MethodHandler {
|
|
|
|
|
|
- private static final Set<String> excludedMethodName = buildExcludedMethodName();
|
|
|
private static final InterceptorManager interMan = InterceptorManager.me();
|
|
|
|
|
|
@Override
|
|
|
public Object invoke(Object target, Method method, Method methodProxy, Object[] args) throws Throwable {
|
|
|
- if (excludedMethodName.contains(method.getName())) {
|
|
|
- return methodProxy.invoke(target, args);
|
|
|
- }
|
|
|
-
|
|
|
Class<?> targetClass = target.getClass().getSuperclass();
|
|
|
|
|
|
MethodKey key = InterceptorCache.getMethodKey(targetClass, method);
|
|
|
@@ -60,18 +53,6 @@ class JavassistCallback implements MethodHandler {
|
|
|
invocation.invoke();
|
|
|
return invocation.getReturnValue();
|
|
|
}
|
|
|
-
|
|
|
- private static final Set<String> buildExcludedMethodName() {
|
|
|
- Set<String> excludedMethodName = new HashSet<String>(64, 0.25F);
|
|
|
- Method[] methods = Object.class.getDeclaredMethods();
|
|
|
- for (Method m : methods) {
|
|
|
- excludedMethodName.add(m.getName());
|
|
|
- }
|
|
|
- // getClass() registerNatives() can not be enhanced
|
|
|
- // excludedMethodName.remove("getClass");
|
|
|
- // excludedMethodName.remove("registerNatives");
|
|
|
- return excludedMethodName;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|