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("检查安全");
 }

相关文章:

  • 2021-08-09
  • 2021-09-26
  • 2022-03-08
  • 2021-10-16
  • 2021-10-24
  • 2021-06-26
猜你喜欢
  • 2021-12-16
  • 2022-01-14
  • 2021-11-02
  • 2021-10-16
  • 2022-12-23
相关资源
相似解决方案