skywalking-java/apm-sniffer/apm-sdk-plugin
Gong Dewei 267aba8fad
Improve bytebuddy class enhance for retransform classes (#561)
* SWAuxiliaryTypeNamingStrategy
Auxiliary type name pattern: <origin_class_name>$<name_trait>$auxiliary$<auxiliary_type_instance_hash>

* DelegateNamingResolver
Interceptor delegate field name pattern: <name_trait>$delegate$<class_name_hash>$<plugin_define_hash>$<intercept_point_hash>

* SWMethodNameTransformer
Renamed origin method pattern: <name_trait>$original$<method_name>$<method_description_hash>

* SWImplementationContextFactory
Method cache value field pattern: cachedValue$<name_trait>$<origin_class_name_hash>$<field_value_hash>
Accessor method name pattern:  <renamed_origin_method>$accessor$<name_trait>$<origin_class_name_hash>

Here is an example of manipulated enhanced class with new naming policies of auxiliary classes, fields, and methods

```java
 import sample.mybatis.controller.HotelController$sw$auxiliary$19cja42;
 import sample.mybatis.controller.HotelController$sw$auxiliary$p257su0;
 import sample.mybatis.domain.Hotel;
 import sample.mybatis.service.HotelService;

 @RequestMapping(value={"/hotel"})
 @RestController
 public class HotelController
 implements EnhancedInstance {
     @Autowired
     @Lazy
     private HotelService hotelService;
     private volatile Object _$EnhancedClassField_ws;

     // Interceptor delegate fields
     public static volatile /* synthetic */ InstMethodsInter sw$delegate$td03673$ain2do0$8im5jm1;
     public static volatile /* synthetic */ InstMethodsInter sw$delegate$td03673$ain2do0$edkmf61;
     public static volatile /* synthetic */ ConstructorInter sw$delegate$td03673$ain2do0$qs9unv1;
     public static volatile /* synthetic */ InstMethodsInter sw$delegate$td03673$fl4lnk1$m3ia3a2;
     public static volatile /* synthetic */ InstMethodsInter sw$delegate$td03673$fl4lnk1$sufrvp1;
     public static volatile /* synthetic */ ConstructorInter sw$delegate$td03673$fl4lnk1$cteu7s1;

     // Origin method cache value field
     private static final /* synthetic */ Method cachedValue$sw$td03673$g5sobj1;

     public HotelController() {
         this(null);
         sw$delegate$td03673$ain2do0$qs9unv1.intercept(this, new Object[0]);
     }

     private /* synthetic */ HotelController(sw.auxiliary.p257su0 p257su02) {
     }

     @GetMapping(value={"city/{cityId}"})
     public Hotel selectByCityId(@PathVariable(value="cityId") int n) {
         // call interceptor with auxiliary type and parameters and origin method object
         return (Hotel)sw$delegate$td03673$ain2do0$8im5jm1.intercept(this, new Object[]{n}, new HotelController$sw$auxiliary$19cja42(this, n), cachedValue$sw$td03673$g5sobj1);
     }

     // Renamed origin method
     private /* synthetic */ Hotel sw$origin$selectByCityId$a8458p3(int cityId) {
/*22*/         return this.hotelService.selectByCityId(cityId);
     }

     // Accessor of renamed origin method, calling from auxiliary type
     final /* synthetic */ Hotel sw$origin$selectByCityId$a8458p3$accessor$sw$td03673(int n) {
         // Calling renamed origin method
         return this.sw$origin$selectByCityId$a8458p3(n);
     }

     @Override
     public Object getSkyWalkingDynamicField() {
         return this._$EnhancedClassField_ws;
     }

     @Override
     public void setSkyWalkingDynamicField(Object object) {
         this._$EnhancedClassField_ws = object;
     }

     static {
         ClassLoader.getSystemClassLoader().loadClass("org.apache.skywalking.apm.dependencies.net.bytebuddy.dynamic.Nexus").getMethod("initialize", Class.class, Integer.TYPE).invoke(null, HotelController.class, -1072476370);
         // Method object
         cachedValue$sw$td03673$g5sobj1 = HotelController.class.getMethod("selectByCityId", Integer.TYPE);
     }
 }
```

Auxiliary type of Constructor : 
```java
class HotelController$sw$auxiliary$p257su0 {
}
```

Auxiliary type of  `selectByCityId` method: 
```java
class HotelController$sw$auxiliary$19cja42
implements Runnable,
Callable {
    private HotelController argument0;
    private int argument1;

    public Object call() throws Exception {
        return this.argument0.sw$origin$selectByCityId$a8458p3$accessor$sw$td03673(this.argument1);
    }

    @Override
    public void run() {
        this.argument0.sw$origin$selectByCityId$a8458p3$accessor$sw$td03673(this.argument1);
    }

    HotelController$sw$auxiliary$19cja42(HotelController hotelController, int n) {
        this.argument0 = hotelController;
        this.argument1 = n;
    }
}
```
2023-06-24 20:50:10 +08:00
..
activemq-5.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
apm-armeria-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
asynchttpclient-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
avro-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
baidu-brpc-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
baidu-brpc-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
canal-1.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
cassandra-java-driver-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
clickhouse-0.3.1-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
clickhouse-0.3.2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
cxf-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
dbcp-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
druid-1.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
dubbo-2.7.x-conflict-patch Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
dubbo-2.7.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
dubbo-3.x-conflict-patch Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
dubbo-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
dubbo-conflict-patch Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
dubbo-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
elastic-job-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
elasticjob-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
elasticsearch-5.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
elasticsearch-6.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
elasticsearch-7.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
feign-default-http-9.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
finagle-6.25.x-plugin Improve bytebuddy class enhance for retransform classes (#561) 2023-06-24 20:50:10 +08:00
graphql-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
grizzly-2.3.x-4.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
grizzly-2.3.x-4.x-work-threadpool-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
grpc-1.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
guava-eventbus-plugin fix npe in guava eventbus plugin (#559) 2023-06-21 14:32:18 +08:00
h2-1.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
hbase-1.x-2.x-plugin Feature/fix spring data hadoop (#546) 2023-06-06 16:21:03 +08:00
hikaricp-3.x-4.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
httpClient-4.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
httpasyncclient-4.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
httpclient-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
httpclient-5.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
httpclient-commons Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
hutool-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
hystrix-1.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
impala-jdbc-2.6.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
influxdb-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
jdbc-commons Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
jedis-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
jersey-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
jersey-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
jetty-plugin Support jetty 11 (#545) 2023-06-06 09:39:34 +08:00
jetty-thread-pool-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
jsonrpc4j-1.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
kafka-commons Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
kafka-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
kylin-jdbc-2.6.x-3.x-4.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
lettuce-5.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
light4j-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mariadb-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
micronaut-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mongodb-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mongodb-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mongodb-4.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
motan-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mssql-commons Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mssql-jdbc-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mssql-jtds-1.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mysql-5.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mysql-6.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mysql-8.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
mysql-common Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
nats-2.14.x-2.15.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
neo4j-4.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
netty-socketio-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
nutz-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
okhttp-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
okhttp-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
okhttp-4.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
okhttp-common Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
play-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
postgresql-8.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
pulsar-2.2-2.7-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
pulsar-2.8.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
pulsar-common Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
quasar-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
rabbitmq-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
redisson-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
resteasy-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
rocketMQ-3.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
rocketMQ-4.x-plugin add RocketMQ 5.x plugin (#536) 2023-06-07 22:05:08 +08:00
rocketMQ-5.x-plugin add RocketMQ 5.x plugin (#536) 2023-06-07 22:05:08 +08:00
servicecomb-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
shardingsphere-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
sofarpc-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
solrj-7.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
spring-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
spymemcached-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
struts2-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
thrift-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
tomcat-7.x-8.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
tomcat-10x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
tomcat-thread-pool-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
undertow-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
undertow-worker-thread-pool-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
vertx-plugins Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
xmemcached-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
xxl-job-2.x-plugin Release 8.16.0 and set 8.17.0-SNAPSHOT for next iteration (#543) 2023-05-31 22:46:05 +08:00
pom.xml add RocketMQ 5.x plugin (#536) 2023-06-07 22:05:08 +08:00