Class Utils


  • public class Utils
    extends Object
    • Method Detail

      • getAgentClassLoader

        public static ClassLoader getAgentClassLoader()
        Return the classloader the core agent is running on.
      • getExtensionsClassLoader

        public static ClassLoader getExtensionsClassLoader()
      • getBootstrapProxy

        public static io.opentelemetry.javaagent.bootstrap.AgentClassLoader.BootstrapClassLoaderProxy getBootstrapProxy()
        Return a classloader which can be used to look up bootstrap resources.
      • getResourceName

        public static String getResourceName​(String className)
        com.foo.Bar to com/foo/Bar.class
      • getClassName

        public static String getClassName​(String internalName)
        com/foo/Bar to com.foo.Bar
      • getInternalName

        public static String getInternalName​(Class<?> clazz)
        com.foo.Bar to com/foo/Bar
      • convertToInnerClassName

        public static String convertToInnerClassName​(String className)
        Convert class name to a format that can be used as part of inner class name by replacing all '.'s with '$'s.
        Parameters:
        className - class named to be converted
        Returns:
        converted name
      • getMethodDefinition

        public static net.bytebuddy.description.method.MethodDescription getMethodDefinition​(net.bytebuddy.description.type.TypeDefinition type,
                                                                                             String methodName)
        Get method definition for given TypeDefinition and method name.
        Parameters:
        type - type
        methodName - method name
        Returns:
        MethodDescription for given method
        Throws:
        IllegalStateException - if more then one method matches (i.e. in case of overloaded methods) or if no method found