Answer the question
In order to leave comments, you need to log in
How to create a proxy for a class in Java?
Good afternoon.
There are many places on the Internet where you can find instructions for creating a Proxy wrapper for a set of interfaces. This is done with java.lang.reflect.Proxy.newProxyInstance(). But this method cannot create a proxy wrapper for a non-interface class.
Nevertheless, while studying Java EE, namely CDI, namely interceptors, I found that the container creates a proxy for the class, and not for the interface. For my MyTest class, he created a wrapper org.jboss.weld.proxies.MyTest$Proxy$_$$_WeldSubclass.
The question is, should I do it myself?
Thank you.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question