提交 78bbfd0f 编写于 作者: A ascrutae

modify support spring version

上级 2699a0fe
......@@ -82,12 +82,12 @@
</dependency>
<dependency>
<groupId>org.skywalking</groupId>
<artifactId>apm-resttemplate-plugin</artifactId>
<artifactId>apm-resttemplate-4.3.x-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.skywalking</groupId>
<artifactId>apm-spring-concurrent-util-plugin</artifactId>
<artifactId>apm-spring-concurrent-util-4.x-plugin</artifactId>
<version>${project.version}</version>
</dependency>
......
spring-concurrent-util-4.3.8=org.skywalking.apm.plugin.spring.concurrent.define.FailureCallbackInstrumentation
spring-concurrent-util-4.3.8=org.skywalking.apm.plugin.spring.concurrent.define.SuccessCallbackInstrumentation
spring-concurrent-util-4.3.8=org.skywalking.apm.plugin.spring.concurrent.define.ListenableFutureCallbackInstrumentation
......@@ -7,17 +7,17 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apm-spring-concurrent-util-4.3.x-plugin</artifactId>
<artifactId>apm-spring-concurrent-util-4.x-plugin</artifactId>
<packaging>jar</packaging>
<name>concurrent-util-4.3.x-plugin</name>
<name>concurrent-util-4.x-plugin</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.8.RELEASE</version>
<version>4.3.10.RELEASE</version>
<scope>provided</scope>
</dependency>
</dependencies>
......
spring-concurrent-util-4.x=org.skywalking.apm.plugin.spring.concurrent.define.FailureCallbackInstrumentation
spring-concurrent-util-4.x=org.skywalking.apm.plugin.spring.concurrent.define.SuccessCallbackInstrumentation
spring-concurrent-util-4.x=org.skywalking.apm.plugin.spring.concurrent.define.ListenableFutureCallbackInstrumentation
......@@ -11,10 +11,8 @@
<artifactId>spring-plugins</artifactId>
<modules>
<!--<module>concurrent-util-4.3.x-plugin</module>
<module>resttemplate-4.3.x-plugin</module>-->
<module>concurrent-util-4.3.x-plugin</module>
<module>resttemplate-4.3.x-plugin</module>
<module>concurrent-util-4.x-plugin</module>
<module>resttemplate-4.x-plugin</module>
</modules>
<packaging>pom</packaging>
......
spring-resttemplate-4.3.8=org.skywalking.apm.plugin.spring.resttemplate.async.define.RestTemplateInstrumentation
spring-resttemplate-4.3.8=org.skywalking.apm.plugin.spring.resttemplate.async.define.ResponseExtractorFutureInstrumentation
spring-resttemplate-4.3.8=org.skywalking.apm.plugin.spring.resttemplate.sync.define.RestTemplateInstrumentation
......@@ -17,7 +17,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.8.RELEASE</version>
<version>4.3.10.RELEASE</version>
<scope>provided</scope>
</dependency>
</dependencies>
......
......@@ -2,7 +2,6 @@ package org.skywalking.apm.plugin.spring.resttemplate.async;
import java.lang.reflect.Method;
import java.net.URI;
import java.util.List;
import org.skywalking.apm.agent.core.context.ContextManager;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
......@@ -14,8 +13,8 @@ public class FutureGetInterceptor implements InstanceMethodsAroundInterceptor {
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
MethodInterceptResult result) throws Throwable {
List<Object> cacheValues = (List<Object>)objInst.getSkyWalkingDynamicField();
ContextManager.createLocalSpan("future/get:" + ((URI)cacheValues.get(0)).getPath());
Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField();
ContextManager.createLocalSpan("future/get:" + ((URI)cacheValues[0]).getPath());
}
@Override
......
......@@ -38,8 +38,10 @@ public class RestExecuteInterceptor implements InstanceMethodsAroundInterceptor
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField();
cacheValues[3] = ContextManager.capture();
((EnhancedInstance)ret).setSkyWalkingDynamicField(cacheValues);
cacheValues[2] = ContextManager.capture();
if (ret != null) {
((EnhancedInstance)ret).setSkyWalkingDynamicField(cacheValues);
}
ContextManager.stopSpan();
return ret;
}
......
package org.springframework.http.client;
import java.lang.reflect.Method;
import java.util.List;
import org.skywalking.apm.agent.core.conf.Config;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
......@@ -19,7 +18,9 @@ public class RestRequestInterceptor implements InstanceMethodsAroundInterceptor
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable {
AbstractAsyncClientHttpRequest clientHttpRequest = (AbstractAsyncClientHttpRequest)ret;
clientHttpRequest.getHeaders().set(Config.Plugin.Propagation.HEADER_NAME, String.valueOf(((List<Object>)objInst.getSkyWalkingDynamicField()).get(1)));
if (ret != null) {
clientHttpRequest.getHeaders().set(Config.Plugin.Propagation.HEADER_NAME, String.valueOf(((Object[])objInst.getSkyWalkingDynamicField())[1]));
}
return ret;
}
......
spring-resttemplate-4.x=org.skywalking.apm.plugin.spring.resttemplate.async.define.RestTemplateInstrumentation
spring-resttemplate-4.x=org.skywalking.apm.plugin.spring.resttemplate.async.define.ResponseExtractorFutureInstrumentation
spring-resttemplate-4.x=org.skywalking.apm.plugin.spring.resttemplate.sync.define.RestTemplateInstrumentation
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册