Class ReferenceCollector
- java.lang.Object
-
- io.opentelemetry.javaagent.tooling.muzzle.collector.ReferenceCollector
-
public class ReferenceCollector extends java.lang.ObjectLinkedHashMapis used for reference map to guarantee a deterministic order of iteration, so that bytecode generated based on it would also be deterministic.This class is only called at compile time by the
MuzzleCodeGenerationPluginByteBuddy plugin.
-
-
Constructor Summary
Constructors Constructor Description ReferenceCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollectReferencesFromAdvice(java.lang.String adviceClassName)Traverse a graph of classes starting fromadviceClassNameand collect all references to both internal (instrumentation) and external classes.voidcollectReferencesFromResource(java.lang.String resource)If passedresourcepath points to an SPI file (either JavaServiceLoaderor AWS SDKExecutionInterceptor) reads the file and adds every implementation as a reference, traversing the graph of classes until a non-instrumentation (external) class is encountered.java.util.Map<java.lang.String,Reference>getReferences()java.util.List<java.lang.String>getSortedHelperClasses()
-
-
-
Method Detail
-
collectReferencesFromResource
public void collectReferencesFromResource(java.lang.String resource)
If passedresourcepath points to an SPI file (either JavaServiceLoaderor AWS SDKExecutionInterceptor) reads the file and adds every implementation as a reference, traversing the graph of classes until a non-instrumentation (external) class is encountered.- Parameters:
resource- path to the resource file, same as inClassLoader.getResource(String)- See Also:
InstrumentationClassPredicate
-
collectReferencesFromAdvice
public void collectReferencesFromAdvice(java.lang.String adviceClassName)
Traverse a graph of classes starting fromadviceClassNameand collect all references to both internal (instrumentation) and external classes.The graph of classes is traversed until a non-instrumentation (external) class is encountered.
- Parameters:
adviceClassName- Starting point for generating references.- See Also:
InstrumentationClassPredicate
-
getReferences
public java.util.Map<java.lang.String,Reference> getReferences()
-
getSortedHelperClasses
public java.util.List<java.lang.String> getSortedHelperClasses()
-
-