mardi 12 avril 2016

How proxy instance of JDK proxy is passed into Invocation handler?

I have checked this stackoverflow post. But still I did not understand.

In JDK proxy, the Proxy.newInstance(arg1,arg2,arg3) creates the new proxy instance. when we call a method on this proxy instance it calls its associated invocation handler. Invocation handler's invoke method delegates the call to the actual method.

The invoke method has 3 arguments. The first one is mentioned as proxy instance on which the call is made. My doubt is how the proxy instance is passed to invocation handler invoke method?





Aucun commentaire:

Enregistrer un commentaire