Class MuzzleGradlePluginUtil
- java.lang.Object
-
- io.opentelemetry.javaagent.tooling.muzzle.matcher.MuzzleGradlePluginUtil
-
public final class MuzzleGradlePluginUtil extends Object
Entry point for the muzzle gradle plugin.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertInstrumentationMuzzled(ClassLoader agentClassLoader, ClassLoader userClassLoader, boolean assertPass)Verifies that all instrumentations present in theagentClassLoadercan be safely applied to the passeduserClassLoader.static voidprintMuzzleReferences(ClassLoader instrumentationClassLoader)Prints all references from all instrumentation modules present in the passedinstrumentationClassLoader.
-
-
-
Method Detail
-
assertInstrumentationMuzzled
public static void assertInstrumentationMuzzled(ClassLoader agentClassLoader, ClassLoader userClassLoader, boolean assertPass) throws Exception
Verifies that all instrumentations present in theagentClassLoadercan be safely applied to the passeduserClassLoader.This method throws whenever one of the following step fails (and
assertPassis true):userClassLoaderis not matched by theInstrumentationModule.classLoaderMatcher()methodReferenceMatcherof any instrumentation module finds any mismatch- any helper class defined in
InstrumentationModule.getMuzzleHelperClassNames()fails to be injected intouserClassLoader
When
assertPass = falsethis method behaves in an opposite way: failure in any of the first two steps is expected (helper classes are not injected at all).This method is repeatedly called by the
:muzzlegradle task - each tested dependency version passes differentuserClassLoader.- Throws:
Exception
-
printMuzzleReferences
public static void printMuzzleReferences(ClassLoader instrumentationClassLoader)
Prints all references from all instrumentation modules present in the passedinstrumentationClassLoader.Called by the
printMuzzleReferencesgradle task.
-
-