修改调用链示例
This commit is contained in:
parent
0f55fc14f8
commit
47745ccb03
|
|
@ -0,0 +1,30 @@
|
|||
package com.ai.cloud.skywalking.plugin.spring.common;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.spring.Tracing;
|
||||
|
||||
public class CallChainA {
|
||||
private CallChainB callChainB;
|
||||
private CallChainD callChainD;
|
||||
|
||||
@Tracing
|
||||
public void doBusiness() {
|
||||
callChainB.doBusiness();
|
||||
callChainD.doBusiness();
|
||||
}
|
||||
|
||||
public CallChainB getCallChainB() {
|
||||
return callChainB;
|
||||
}
|
||||
|
||||
public void setCallChainB(CallChainB callChainB) {
|
||||
this.callChainB = callChainB;
|
||||
}
|
||||
|
||||
public CallChainD getCallChainD() {
|
||||
return callChainD;
|
||||
}
|
||||
|
||||
public void setCallChainD(CallChainD callChainD) {
|
||||
this.callChainD = callChainD;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.ai.cloud.skywalking.plugin.spring.common;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.spring.Tracing;
|
||||
|
||||
public class CallChainB {
|
||||
|
||||
private CallChainC callChainC;
|
||||
|
||||
@Tracing
|
||||
public void doBusiness() {
|
||||
callChainC.doBusiness();
|
||||
}
|
||||
|
||||
public CallChainC getCallChainC() {
|
||||
return callChainC;
|
||||
}
|
||||
|
||||
public void setCallChainC(CallChainC callChainC) {
|
||||
this.callChainC = callChainC;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.ai.cloud.skywalking.plugin.spring.common;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.spring.Tracing;
|
||||
|
||||
public class CallChainC {
|
||||
|
||||
@Tracing
|
||||
public void doBusiness() {
|
||||
System.out.println("I'm here");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.ai.cloud.skywalking.plugin.spring.common;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.spring.Tracing;
|
||||
|
||||
public class CallChainD {
|
||||
|
||||
@Tracing
|
||||
public void doBusiness() {
|
||||
System.out.println("me too");
|
||||
}
|
||||
}
|
||||
|
|
@ -6,8 +6,7 @@ public class TestBuriedPoint {
|
|||
|
||||
public static void main(String[] args) {
|
||||
ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath*:springConfig-common.xml");
|
||||
TestBuriedPointBean testBuriedPointBean = classPathXmlApplicationContext.getBean(TestBuriedPointBean.class);
|
||||
testBuriedPointBean.sayTest();
|
||||
System.out.println(testBuriedPointBean.addStr(1));
|
||||
CallChainA callChainA = classPathXmlApplicationContext.getBean(CallChainA.class);
|
||||
callChainA.doBusiness();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
package com.ai.cloud.skywalking.plugin.spring.common;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.spring.Tracing;
|
||||
|
||||
|
||||
public class TestBuriedPointBean {
|
||||
@Tracing
|
||||
public void sayTest() throws RuntimeException, IllegalStateException {
|
||||
System.out.println("say Test");
|
||||
}
|
||||
|
||||
@Tracing
|
||||
public static void sayTest1() {
|
||||
System.out.println("xx");
|
||||
}
|
||||
|
||||
@Tracing
|
||||
public String addStr(int a, String c) {
|
||||
throw new RuntimeException("aa");
|
||||
}
|
||||
|
||||
@Tracing
|
||||
public String addStr(int a) {
|
||||
throw new RuntimeException("aa");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,17 +2,20 @@
|
|||
<beans
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/aop
|
||||
http://www.springframework.org/schema/aop/spring-aop.xsd">
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
|
||||
|
||||
<bean id="postProcess1"
|
||||
class="com.ai.cloud.skywalking.plugin.spring.TracingEnhanceProcessor">
|
||||
</bean>
|
||||
|
||||
<bean id="testBean" class="com.ai.cloud.skywalking.plugin.spring.common.TestBuriedPointBean"/>
|
||||
|
||||
<aop:aspectj-autoproxy/>
|
||||
<bean id="callChainC" class="com.ai.cloud.skywalking.plugin.spring.common.CallChainC"/>
|
||||
<bean id="callChainD" class="com.ai.cloud.skywalking.plugin.spring.common.CallChainD"/>
|
||||
<bean id="callChainB" class="com.ai.cloud.skywalking.plugin.spring.common.CallChainB">
|
||||
<property name="callChainC" ref="callChainC"/>
|
||||
</bean>
|
||||
<bean id="callChainA" class="com.ai.cloud.skywalking.plugin.spring.common.CallChainA">
|
||||
<property name="callChainB" ref="callChainB"/>
|
||||
<property name="callChainD" ref="callChainD"/>
|
||||
</bean>
|
||||
</beans>
|
||||
Loading…
Reference in New Issue