1234567891011121314151617181920212223242526272829303132333435363738 |
- package cn.nosum.support.proxy;
- import java.lang.reflect.InvocationHandler;
- /**
- * InvocationHandlerFactory.
- *
- * @author Young
- */
- public interface InvocationHandlerFactory {
- /**
- * create InvocationHandler。
- *
- * @param target Target Object Information
- * @return InvocationHandler
- */
- InvocationHandler create(Target target);
- /**
- * Like {@link InvocationHandler#invoke(Object, java.lang.reflect.Method, Object[])}, except for a
- * single method.
- */
- interface MethodHandler {
- Object invoke(Object[] argv) throws Throwable;
- }
- final class Default implements InvocationHandlerFactory {
- @Override
- public InvocationHandler create(Target target) {
- return new ReflectiveDynamicClientCreator.DynamicMethodsInvocationHandler(target);
- }
- }
- }
|