use of com.navercorp.pinpoint.plugin.tomcat.TraceAccessor in project pinpoint by naver.
the class RequestRecycleInterceptor method before.
@Override
public void before(Object target, Object[] args) {
logger.beforeInterceptor(target, target.getClass().getName(), targetMethod.getName(), "", args);
try {
if (target instanceof AsyncAccessor) {
// reset
((AsyncAccessor) target)._$PINPOINT$_setAsync(Boolean.FALSE);
}
if (target instanceof TraceAccessor) {
final Trace trace = ((TraceAccessor) target)._$PINPOINT$_getTrace();
if (trace != null && trace.canSampled()) {
// end of root span
trace.close();
}
// reset
((TraceAccessor) target)._$PINPOINT$_setTrace(null);
}
} catch (Throwable t) {
logger.warn("Failed to BEFORE process. {}", t.getMessage(), t);
}
}
Aggregations