what’s the best approach to unwrap a dynamic proxy to retrieve the original object beneath?
The dynamic proxy has been created using java.lang.reflect.Proxy.newProxyInstance()
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Each proxy has an
InvocationHandlerassociated with it. Only theInvocationHandlerknows which object (if any) underlies the proxy. If you control the creation of the proxy, then you can supply your ownInvocationHandlerthat will have the extra functionality that you desire (i.e. will be able to disclose the underlying object.) If you don’t, then I am afraid you’re out of luck.