|
20 | 20 |
|
21 | 21 | import net.bytebuddy.description.method.MethodDescription; |
22 | 22 | import net.bytebuddy.matcher.ElementMatcher; |
| 23 | +import org.apache.skywalking.apm.agent.core.plugin.WitnessMethod; |
23 | 24 | import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; |
24 | 25 | import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; |
25 | 26 | import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; |
26 | 27 | import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; |
27 | 28 | import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch; |
28 | 29 |
|
| 30 | +import java.util.Collections; |
| 31 | +import java.util.List; |
| 32 | + |
29 | 33 | import static net.bytebuddy.matcher.ElementMatchers.named; |
| 34 | +import static net.bytebuddy.matcher.ElementMatchers.returns; |
30 | 35 | import static net.bytebuddy.matcher.ElementMatchers.takesArguments; |
31 | 36 |
|
32 | 37 | public class SynchronousDispatcherInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { |
@@ -83,4 +88,17 @@ public boolean isOverrideArgs() { |
83 | 88 | protected ClassMatch enhanceClass() { |
84 | 89 | return NameMatch.byName(ENHANCE_CLASS); |
85 | 90 | } |
| 91 | + |
| 92 | + @Override |
| 93 | + protected String[] witnessClasses() { |
| 94 | + return new String[]{"org.jboss.resteasy.core.InternalDispatcher"}; |
| 95 | + } |
| 96 | + |
| 97 | + @Override |
| 98 | + protected List<WitnessMethod> witnessMethods() { |
| 99 | + return Collections.singletonList(new WitnessMethod( |
| 100 | + "org.jboss.resteasy.spi.Dispatcher", |
| 101 | + named("internalInvocation").and(returns(named("jakarta.ws.rs.core.Response"))) |
| 102 | + )); |
| 103 | + } |
86 | 104 | } |
0 commit comments