-
-
Notifications
You must be signed in to change notification settings - Fork 841
Open
Labels
Description
new AgentBuilder.Default()
.type(ElementMatchers.is(HikariDataSource.class))
.transform(new Transformer() {
@Override
public Builder<?> transform(Builder<?> builder, TypeDescription typeDescription,
ClassLoader classLoader, JavaModule module, ProtectionDomain protectionDomain) {
return builder
.defineField("ds1", HikariDataSource.class, Visibility.PUBLIC)
.defineField("proxy", Boolean.class, Visibility.PUBLIC)
.defineField("current", Integer.class, Visibility.PUBLIC);
}
})
.with(AgentBuilder.Listener.StreamWriting.toSystemError())
.with(AgentBuilder.InstallationListener.StreamWriting.toSystemError())
.with(RedefinitionStrategy.RETRANSFORMATION)
.installOn(inst);when run it does not work, and log:
[Byte Buddy] DISCOVERY com.zaxxer.hikari.HikariDataSource [sun.misc.Launcher$AppClassLoader@18b4aac2, null, Thread[main,5,main], loaded=true]
[Byte Buddy] TRANSFORM com.zaxxer.hikari.HikariDataSource [sun.misc.Launcher$AppClassLoader@18b4aac2, null, Thread[main,5,main], loaded=true]
[Byte Buddy] COMPLETE com.zaxxer.hikari.HikariDataSource [sun.misc.Launcher$AppClassLoader@18b4aac2, null, Thread[main,5,main], loaded=true]
when remove the ds1 field, all works fine
how to reload the loaded class, thanks