Search in sources :

Example 1 with TraceAccessor

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);
    }
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) AsyncAccessor(com.navercorp.pinpoint.plugin.tomcat.AsyncAccessor) TraceAccessor(com.navercorp.pinpoint.plugin.tomcat.TraceAccessor)

Aggregations

Trace (com.navercorp.pinpoint.bootstrap.context.Trace)1 AsyncAccessor (com.navercorp.pinpoint.plugin.tomcat.AsyncAccessor)1 TraceAccessor (com.navercorp.pinpoint.plugin.tomcat.TraceAccessor)1