java-org.hwo/src/org/hwo/proxy/AbstractInterceptor.java

21 lines
418 B
Java

package org.hwo.proxy;
import java.lang.reflect.Method;
public abstract class AbstractInterceptor implements Interceptor {
@Override
public abstract Object invoke(Method method, Object target, Object[] params);
public Object invokeTarget(Method method, Object target, Object[] params)
{
try {
return method.invoke(target, params);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}