InvocationHandlerFactory.java 630 B

12345678910111213141516171819202122232425262728
  1. package cn.nosum.support.proxy;
  2. import java.lang.reflect.InvocationHandler;
  3. /**
  4. * InvocationHandlerFactory.
  5. *
  6. * @author Young
  7. */
  8. public interface InvocationHandlerFactory {
  9. /**
  10. * create InvocationHandler。
  11. *
  12. * @param target Target Object Information
  13. * @return InvocationHandler
  14. */
  15. <T> InvocationHandler create(Target<T> target);
  16. final class Default implements InvocationHandlerFactory {
  17. @Override
  18. public <T> InvocationHandler create(Target<T> target) {
  19. return new ReflectiveDynamicClientCreator.DynamicMethodsInvocationHandler(target);
  20. }
  21. }
  22. }