hucaicai opened a new issue #7402:
URL: https://github.com/apache/skywalking/issues/7402
private static class Transformer implements AgentBuilder.Transformer {
private PluginFinder pluginFinder;
Transformer(PluginFinder pluginFinder) {
this.pluginFinder = pluginFinder;
}
@Override
public DynamicType.Builder<?> transform(final DynamicType.Builder<?>
builder,
final TypeDescription
typeDescription,
final ClassLoader
classLoader,
final JavaModule module) {
LoadedLibraryCollector.registerURLClassLoader(classLoader);
List<AbstractClassEnhancePluginDefine> pluginDefines =
pluginFinder.find(typeDescription);
if (pluginDefines.size() > 0) {
DynamicType.Builder<?> newBuilder = builder;
EnhanceContext context = new EnhanceContext();
for (AbstractClassEnhancePluginDefine define :
pluginDefines) {
DynamicType.Builder<?> possibleNewBuilder =
define.define(
typeDescription, newBuilder, classLoader,
context);
if (possibleNewBuilder != null) {
newBuilder = possibleNewBuilder;
}
}
if (context.isEnhanced()) {
LOGGER.debug("Finish the prepare stage for {}.",
typeDescription.getName());
}
return newBuilder;
}
LOGGER.debug("Matched class {}, but ignore by finding
mechanism.", typeDescription.getTypeName());
return builder;
}
}
When multiple plug-ins are hit, only the last one will take effect。
var newbuilder will be overwritten
How to make multiple plug-ins effective at the same time。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]