diff --git a/plugins/arcus/src/main/java/com/navercorp/pinpoint/plugin/arcus/ArcusPlugin.java b/plugins/arcus/src/main/java/com/navercorp/pinpoint/plugin/arcus/ArcusPlugin.java index f884a9099702..c4f5d4ccabf8 100644 --- a/plugins/arcus/src/main/java/com/navercorp/pinpoint/plugin/arcus/ArcusPlugin.java +++ b/plugins/arcus/src/main/java/com/navercorp/pinpoint/plugin/arcus/ArcusPlugin.java @@ -112,7 +112,7 @@ private void addCacheManagerEditor() { @Override public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer); - target.addField(ServiceCodeAccessor.class.getName()); + target.addField("com.navercorp.pinpoint.plugin.arcus.ServiceCodeAccessor"); target.addInterceptor("com.navercorp.pinpoint.plugin.arcus.interceptor.CacheManagerConstructInterceptor"); return target.toBytecode(); } @@ -126,7 +126,7 @@ private void addBaseOperationImplEditor() { @Override public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer); - target.addField(ServiceCodeAccessor.class.getName()); + target.addField("com.navercorp.pinpoint.plugin.arcus.ServiceCodeAccessor"); return target.toBytecode(); } @@ -140,8 +140,8 @@ private void addFrontCacheGetFutureEditor() { public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer); - target.addField(CacheNameAccessor.class.getName()); - target.addField(CacheKeyAccessor.class.getName()); + target.addField("com.navercorp.pinpoint.plugin.arcus.CacheNameAccessor"); + target.addField("com.navercorp.pinpoint.plugin.arcus.CacheKeyAccessor"); target.addInterceptor("com.navercorp.pinpoint.plugin.arcus.interceptor.FrontCacheGetFutureConstructInterceptor"); InstrumentMethod get0 = target.getDeclaredMethod("get", new String[]{"long", "java.util.concurrent.TimeUnit"}); @@ -188,7 +188,7 @@ public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, Strin InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer); if (target.hasDeclaredMethod("addOp", new String[]{"java.lang.String", "net.spy.memcached.ops.Operation"})) { - target.addField(ServiceCodeAccessor.class.getName()); + target.addField("com.navercorp.pinpoint.plugin.arcus.ServiceCodeAccessor"); target.addInterceptor("com.navercorp.pinpoint.plugin.arcus.interceptor.AddOpInterceptor"); } @@ -216,7 +216,7 @@ public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, Strin public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer); - target.addField(OperationAccessor.class.getName()); + target.addField("com.navercorp.pinpoint.plugin.arcus.OperationAccessor"); target.addField(AsyncTraceIdAccessor.class.getName()); // setOperation diff --git a/plugins/httpclient3/src/main/java/com/navercorp/pinpoint/plugin/httpclient3/HttpClient3Plugin.java b/plugins/httpclient3/src/main/java/com/navercorp/pinpoint/plugin/httpclient3/HttpClient3Plugin.java index 0a5d901bf47b..c9dbed201a66 100644 --- a/plugins/httpclient3/src/main/java/com/navercorp/pinpoint/plugin/httpclient3/HttpClient3Plugin.java +++ b/plugins/httpclient3/src/main/java/com/navercorp/pinpoint/plugin/httpclient3/HttpClient3Plugin.java @@ -103,10 +103,10 @@ private void addHttpConnectionClass() { public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer); - target.addGetter(HostNameGetter.class.getName(), HttpClient3Constants.FIELD_HOST_NAME); - target.addGetter(PortNumberGetter.class.getName(), HttpClient3Constants.FIELD_PORT_NUMBER); - target.addGetter(ProxyHostNameGetter.class.getName(), HttpClient3Constants.FIELD_PROXY_HOST_NAME); - target.addGetter(ProxyPortNumberGetter.class.getName(), HttpClient3Constants.FIELD_PROXY_PORT_NUMBER); + target.addGetter("com.navercorp.pinpoint.plugin.httpclient3.HostNameGetter", HttpClient3Constants.FIELD_HOST_NAME); + target.addGetter("com.navercorp.pinpoint.plugin.httpclient3.PortNumberGetter", HttpClient3Constants.FIELD_PORT_NUMBER); + target.addGetter("com.navercorp.pinpoint.plugin.httpclient3.ProxyHostNameGetter", HttpClient3Constants.FIELD_PROXY_HOST_NAME); + target.addGetter("com.navercorp.pinpoint.plugin.httpclient3.ProxyPortNumberGetter", HttpClient3Constants.FIELD_PROXY_PORT_NUMBER); InstrumentMethod open = target.getDeclaredMethod("open"); diff --git a/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/HttpClient4Constants.java b/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/HttpClient4Constants.java index 1f7d0d614a7c..318480fe3dbb 100644 --- a/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/HttpClient4Constants.java +++ b/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/HttpClient4Constants.java @@ -33,12 +33,9 @@ private HttpClient4Constants() { public static final ServiceType HTTP_CLIENT_4 = ServiceTypeFactory.of(9052, "HTTP_CLIENT_4", RECORD_STATISTICS); public static final ServiceType HTTP_CLIENT_4_INTERNAL = ServiceTypeFactory.of(9053, "HTTP_CLIENT_4_INTERNAL", "HTTP_CLIENT_4"); - public static final String METADATA_END_POINT = "endPoint"; - public static final String METADATA_DESTINATION_ID = "destinationId"; public static final String METADATA_ASYNC_TRACE_ID = "asyncTraceId"; public static final String FIELD_REQUEST_PRODUCER = "requestProducer"; public static final String FIELD_RESULT_FUTURE = "resultFuture"; public static final String HTTP_CLIENT4_SCOPE = "HttpClient4Scope"; - public static final String HTTP_CLIENT4_EXECUTOR_SCOPE = "HttpClient4ExecutorScope"; } diff --git a/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/HttpClient4Plugin.java b/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/HttpClient4Plugin.java index ce4854744ad7..2b1de646f6e9 100644 --- a/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/HttpClient4Plugin.java +++ b/plugins/httpclient4/src/main/java/com/navercorp/pinpoint/plugin/httpclient4/HttpClient4Plugin.java @@ -282,8 +282,8 @@ private void addDefaultClientExchangeHandlerImplClass() { public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer); - target.addGetter(RequestProducerGetter.class.getName(), HttpClient4Constants.FIELD_REQUEST_PRODUCER); - target.addGetter(ResultFutureGetter.class.getName(), HttpClient4Constants.FIELD_RESULT_FUTURE); + target.addGetter("com.navercorp.pinpoint.plugin.httpclient4.RequestProducerGetter", HttpClient4Constants.FIELD_REQUEST_PRODUCER); + target.addGetter("com.navercorp.pinpoint.plugin.httpclient4.ResultFutureGetter", HttpClient4Constants.FIELD_RESULT_FUTURE); InstrumentMethod start = target.getDeclaredMethod("start"); diff --git a/plugins/jdk-http/src/main/java/com/navercorp/pinpoint/plugin/jdk/http/JdkHttpPlugin.java b/plugins/jdk-http/src/main/java/com/navercorp/pinpoint/plugin/jdk/http/JdkHttpPlugin.java index 9a51b3853d67..4813f1c4891d 100644 --- a/plugins/jdk-http/src/main/java/com/navercorp/pinpoint/plugin/jdk/http/JdkHttpPlugin.java +++ b/plugins/jdk-http/src/main/java/com/navercorp/pinpoint/plugin/jdk/http/JdkHttpPlugin.java @@ -43,10 +43,10 @@ public void setup(ProfilerPluginSetupContext context) { public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer); - target.addGetter(ConnectedGetter.class.getName(), "connected"); + target.addGetter("com.navercorp.pinpoint.plugin.jdk.http.ConnectedGetter", "connected"); if (target.hasField("connecting", "boolean")) { - target.addGetter(ConnectingGetter.class.getName(), "connecting"); + target.addGetter("com.navercorp.pinpoint.plugin.jdk.http.ConnectingGetter", "connecting"); } target.addInterceptor("com.navercorp.pinpoint.plugin.jdk.http.interceptor.HttpURLConnectionInterceptor"); diff --git a/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/OkHttpConstants.java b/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/OkHttpConstants.java index 583d724dca7b..edbf717461c6 100644 --- a/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/OkHttpConstants.java +++ b/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/OkHttpConstants.java @@ -40,4 +40,10 @@ private OkHttpConstants() { public static final String FIELD_USER_RESPONSE = "userResponse"; public static final String FIELD_CONNECTION = "connection"; public static final String FIELD_HTTP_URL = "url"; + + public static final String CONNECTION_GETTER = "com.navercorp.pinpoint.plugin.okhttp.ConnectionGetter"; + public static final String HTTP_URL_GETTER = "com.navercorp.pinpoint.plugin.okhttp.HttpUrlGetter"; + public static final String URL_GETTER = "com.navercorp.pinpoint.plugin.okhttp.UrlGetter"; + public static final String USER_REQUEST_GETTER = "com.navercorp.pinpoint.plugin.okhttp.UserRequestGetter"; + public static final String USER_RESPONSE_GETTER = "com.navercorp.pinpoint.plugin.okhttp.UserResponseGetter"; } diff --git a/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/OkHttpPlugin.java b/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/OkHttpPlugin.java index 1997eb5e898c..fc0aebb2cf48 100644 --- a/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/OkHttpPlugin.java +++ b/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/OkHttpPlugin.java @@ -118,9 +118,9 @@ private void addHttpEngine(final OkHttpPluginConfig config) { @Override public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer); - target.addGetter(UserRequestGetter.class.getName(), OkHttpConstants.FIELD_USER_REQUEST); - target.addGetter(UserResponseGetter.class.getName(), OkHttpConstants.FIELD_USER_RESPONSE); - target.addGetter(ConnectionGetter.class.getName(), OkHttpConstants.FIELD_CONNECTION); + target.addGetter(OkHttpConstants.USER_REQUEST_GETTER, OkHttpConstants.FIELD_USER_REQUEST); + target.addGetter(OkHttpConstants.USER_RESPONSE_GETTER, OkHttpConstants.FIELD_USER_RESPONSE); + target.addGetter(OkHttpConstants.CONNECTION_GETTER, OkHttpConstants.FIELD_CONNECTION); InstrumentMethod sendRequestMethod = target.getDeclaredMethod("sendRequest"); if (sendRequestMethod != null) { @@ -159,11 +159,11 @@ public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, Strin if(instrumentor.exist(loader, "com.squareup.okhttp.HttpUrl")) { // over 2.4.0 - target.addGetter(HttpUrlGetter.class.getName(), OkHttpConstants.FIELD_HTTP_URL); + target.addGetter(OkHttpConstants.HTTP_URL_GETTER, OkHttpConstants.FIELD_HTTP_URL); buildMethod.addInterceptor("com.navercorp.pinpoint.plugin.okhttp.interceptor.RequestBuilderBuildMethodInterceptor"); } else { // 2.0 ~ 2.3 - target.addGetter(UrlGetter.class.getName(), OkHttpConstants.FIELD_HTTP_URL); + target.addGetter(OkHttpConstants.URL_GETTER, OkHttpConstants.FIELD_HTTP_URL); buildMethod.addInterceptor("com.navercorp.pinpoint.plugin.okhttp.interceptor.RequestBuilderBuildMethodBackwardCompatibilityInterceptor"); } } diff --git a/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/UserRequestSetter.java b/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/UserRequestSetter.java deleted file mode 100644 index 63e473e0bb71..000000000000 --- a/plugins/okhttp/src/main/java/com/navercorp/pinpoint/plugin/okhttp/UserRequestSetter.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.navercorp.pinpoint.plugin.okhttp; - -import com.squareup.okhttp.Request; - -/** - * Created by nbp on 2015-09-08. - */ -public interface UserRequestSetter { - Request _$PINPOINT$_getUserRequest(); -} diff --git a/plugins/redis/src/main/java/com/navercorp/pinpoint/plugin/redis/RedisConstants.java b/plugins/redis/src/main/java/com/navercorp/pinpoint/plugin/redis/RedisConstants.java index 92e57cef8ce8..4b06604316e0 100644 --- a/plugins/redis/src/main/java/com/navercorp/pinpoint/plugin/redis/RedisConstants.java +++ b/plugins/redis/src/main/java/com/navercorp/pinpoint/plugin/redis/RedisConstants.java @@ -31,4 +31,7 @@ private RedisConstants() { public static final ServiceType REDIS = ServiceTypeFactory.of(8200, "REDIS", TERMINAL, RECORD_STATISTICS); public static final String REDIS_SCOPE = "redisScope"; + + public static final String END_POINT_ACCESSOR = "com.navercorp.pinpoint.plugin.redis.EndPointAccessor"; + } diff --git a/plugins/redis/src/main/java/com/navercorp/pinpoint/plugin/redis/RedisPlugin.java b/plugins/redis/src/main/java/com/navercorp/pinpoint/plugin/redis/RedisPlugin.java index f6b3b98ad687..4a11a0faf568 100644 --- a/plugins/redis/src/main/java/com/navercorp/pinpoint/plugin/redis/RedisPlugin.java +++ b/plugins/redis/src/main/java/com/navercorp/pinpoint/plugin/redis/RedisPlugin.java @@ -64,7 +64,7 @@ private void addJedisClassEditors(RedisPluginConfig config) { @Override public void handle(InstrumentClass target) throws InstrumentException { - target.addField(EndPointAccessor.class.getName()); + target.addField(RedisConstants.END_POINT_ACCESSOR); } }); @@ -129,7 +129,7 @@ private void addJedisClientClassEditor() { @Override public byte[] doInTransform(Instrumentor instrumentor, ClassLoader classLoader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(classLoader, className, classfileBuffer); - target.addField(EndPointAccessor.class.getName()); + target.addField(RedisConstants.END_POINT_ACCESSOR); final InstrumentMethod constructorEditorBuilderArg1 = target.getConstructor("java.lang.String"); if (constructorEditorBuilderArg1 != null) { @@ -174,7 +174,7 @@ private void addJedisPipelineClassEditors(RedisPluginConfig config) { @Override public void handle(InstrumentClass target) throws InstrumentException { - target.addField(EndPointAccessor.class.getName()); + target.addField(RedisConstants.END_POINT_ACCESSOR); final InstrumentMethod setClientMethodEditorBuilder = target.getDeclaredMethod("setClient", "redis.clients.jedis.Client"); if (setClientMethodEditorBuilder != null) { diff --git a/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatConstants.java b/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatConstants.java index 90bd8dff3be8..d1bd95e7dffb 100644 --- a/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatConstants.java +++ b/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatConstants.java @@ -28,10 +28,12 @@ public final class TomcatConstants { private TomcatConstants() { } - public static final String TYPE_NAME = "TOMCAT"; public static final ServiceType TOMCAT = ServiceTypeFactory.of(1010, "TOMCAT", RECORD_STATISTICS); public static final ServiceType TOMCAT_METHOD = ServiceTypeFactory.of(1011, "TOMCAT_METHOD"); - public static final String ATTRIBUTE_PINPOINT_TRACE = "PINPOINT_TRACE"; public static final String TOMCAT_SERVLET_ASYNC_SCOPE = "TomcatServletAsyncScope"; + + public static final String ASYNC_ACCESSOR = "com.navercorp.pinpoint.plugin.tomcat.AsyncAccessor"; + public static final String TRACE_ACCESSOR = "com.navercorp.pinpoint.plugin.tomcat.TraceAccessor"; + } \ No newline at end of file diff --git a/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatPlugin.java b/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatPlugin.java index f5426c4e879d..0917e1c0d732 100644 --- a/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatPlugin.java +++ b/plugins/tomcat/src/main/java/com/navercorp/pinpoint/plugin/tomcat/TomcatPlugin.java @@ -69,8 +69,8 @@ private void addRequestEditor() { @Override public byte[] doInTransform(Instrumentor instrumentor, ClassLoader classLoader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException { InstrumentClass target = instrumentor.getInstrumentClass(classLoader, className, classfileBuffer); - target.addField(TraceAccessor.class.getName()); - target.addField(AsyncAccessor.class.getName()); + target.addField(TomcatConstants.TRACE_ACCESSOR); + target.addField(TomcatConstants.ASYNC_ACCESSOR); // clear request. InstrumentMethod recycleMethodEditorBuilder = target.getDeclaredMethod("recycle");