MyInvocationHandler.java 518 B

1234567891011121314151617181920212223
  1. package com.boman.save.proxy;
  2. import java.lang.reflect.InvocationHandler;
  3. import java.lang.reflect.Method;
  4. /**
  5. * @author shiqian
  6. * @description
  7. * @date 2021年03月19日 11:04
  8. **/
  9. public class MyInvocationHandler implements InvocationHandler {
  10. private Object target;
  11. public MyInvocationHandler(Object target) {
  12. this.target = target;
  13. }
  14. @Override
  15. public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
  16. return method.invoke(target,args);
  17. }
  18. }