[OJB-developers] dynamic proxies
Brought to you by:
thma
From: Georg S. <ge...@me...> - 2002-03-08 09:34:08
|
Hi, I just implemented a few lines to enable dynamic proxies to also implement interfaces which are implemented by classes further up the inheritance hierarchy. I just added the following lines in RepositoryXmlHandler in the method getDynamicProxyClass: Class[] interfaces = clazz.getInterfaces(); //added from here on Class superClass = clazz; while((superClass = superClass.getSuperclass()) != null) { Class[] superInterfaces = superClass.getInterfaces(); Class[] combInterfaces = new Class[interfaces.length + superInterfaces.length]; System.arraycopy(interfaces,0,combInterfaces,0, interfaces.length); System.arraycopy(superInterfaces,0,combInterfaces, interfaces.length, superInterfaces.length); interfaces = combInterfaces; } //end added Class proxyClass = Proxy.getProxyClass( clazz.getClassLoader(), interfaces); Regards Georg |