Class IndyProxyFactory
java.lang.Object
io.opentelemetry.javaagent.tooling.instrumentation.indy.IndyProxyFactory
Factory for generating proxies which invoke their target via
INVOKEDYNAMIC. Generated
proxy classes have the following properties: The generated proxies have the following basic
structure:
- it has same superclass as the proxied class
- it implements all interfaces implemented by the proxied class
- for every public constructor of the proxied class, it defined a matching public constructor
which:
- invokes the default constructor of the superclass
- invoked the corresponding constructor of the proxied class to generate the object to which the proxy delegates
- it "copies" every declared static and non-static public method, the implementation will delegate to the corresponding method in the proxied class
- all annotations on the proxied class and on its methods are copied to the proxy
Note that only the public methods declared by the proxied class are actually proxied. Inherited methods are not automatically proxied. If you want those to be proxied, you'll need to explicitly override them in the proxied class.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionIndyProxyFactory(Method bootstrapMethod, IndyProxyFactory.BootstrapArgsProvider bootstrapArgsProvider) -
Method Summary
Modifier and TypeMethodDescriptionnet.bytebuddy.dynamic.DynamicType.Unloaded<?>generateProxy(net.bytebuddy.description.type.TypeDescription classToProxy, String proxyClassName) Generates a proxy.
-
Constructor Details
-
IndyProxyFactory
public IndyProxyFactory(Method bootstrapMethod, IndyProxyFactory.BootstrapArgsProvider bootstrapArgsProvider)
-
-
Method Details
-
generateProxy
public net.bytebuddy.dynamic.DynamicType.Unloaded<?> generateProxy(net.bytebuddy.description.type.TypeDescription classToProxy, String proxyClassName) Generates a proxy.- Parameters:
classToProxy- the class for which a proxy will be generatedproxyClassName- the desired fully qualified name for the proxy class- Returns:
- the generated proxy class
-