jeudi 26 novembre 2015

Getting implemented interfaces from the proxy

You normally crate a proxy using

val proxy = Proxy.newProxyInstance(ClassLoader, Class<?>[] interfaces, handler) 

I am interested in the second parameter because I save created proxies in a list and I want to recreate the proxy with the same interfaces later on. Should I memorize interface classes along with the proxy list or there is a way to map proxy to its implementing interfaces, likewise Proxy.getInvocationHandler(proxy) does for handlers?





Aucun commentaire:

Enregistrer un commentaire