if (!intfc.isInterface()) {
throw new IllegalArgumentException(intfc.getClass()
+ " is not an interface");
}
if (!isImplementing(intfc, handler)) {
throw new IllegalArgumentException("Handler object " + handler
+ " is not an instance of " + intfc.getName());
}
Object obj = Proxy.newProxyInstance(
handler.getClass().getClassLoader(),
new Class[] {intfc},
new ProxyClass(handler, interceptor));
return obj;