mufiye commented on issue #9999:
URL: https://github.com/apache/skywalking/issues/9999#issuecomment-1381364286

   I have one question that the constructor writen in the 
`InstanceMethodsAroundInterceptor` can be intercepeted by the defined 
`InstanceConstructorInterceptor`?  For example, the `spanRef` in `afterMethod` 
of `TracerCreateLocalSpanInterceptor`.
   ```
   public class TracerCreateLocalSpanInterceptor implements 
StaticMethodsAroundInterceptor {
       AbstractSpan localSpan;
   
       @Override
       public void beforeMethod(Class clazz, Method method, Object[] 
allArguments, Class<?>[] parameterTypes, MethodInterceptResult result) {
           localSpan = 
ContextManager.createLocalSpan(String.valueOf(allArguments[0]));
       }
   
       @Override
       public Object afterMethod(Class clazz, Method method, Object[] 
allArguments, Class<?>[] parameterTypes, Object ret) {
           SpanRef spanRef = new SpanRef(localSpan);
           return spanRef;
       }
       ...
   }
   ```
   ```
   public class SpanRefConstructInterceptor implements 
InstanceConstructorInterceptor {
       @Override
       public void onConstruct(EnhancedInstance objInst, Object[] allArguments) 
throws Throwable {
           objInst.setSkyWalkingDynamicField(allArguments[0]);
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to