public Object targetObject;
public Object newProxy(Object targetObject) {
this.targetObject = targetObject;
return Proxy.newProxyInstance(targetObject.getClass().getClassLoader(),
targetObject.getClass().getInterfaces(), this);
}
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
checkSecurity();
try {
method.invoke(this.targetObject, args);
} catch (RuntimeException e) {
e.printStackTrace();
}
return null;
}
public void checkSecurity(){
System.out.println("检查安全");
}