use of com.navercorp.pinpoint.plugin.netty.field.accessor.AsyncStartFlagFieldAccessor in project pinpoint by naver.
the class HttpEncoderInterceptor method validate.
private boolean validate(Object[] args) {
if (ArrayUtils.getLength(args) != 3) {
return false;
}
if (!(args[0] instanceof ChannelHandlerContext)) {
return false;
}
ChannelHandlerContext channelHandlerContext = (ChannelHandlerContext) args[0];
Channel channel = channelHandlerContext.channel();
if (channel == null) {
return false;
}
if (!(args[1] instanceof HttpMessage)) {
return false;
}
HttpMessage httpMessage = (HttpMessage) args[1];
if (httpMessage.headers() == null) {
return false;
}
if (!(args[1] instanceof AsyncContextAccessor)) {
return false;
}
if (!(args[1] instanceof AsyncStartFlagFieldAccessor)) {
return false;
}
return true;
}
use of com.navercorp.pinpoint.plugin.netty.field.accessor.AsyncStartFlagFieldAccessor in project pinpoint by naver.
the class HttpEncoderInterceptor method beforeAsync.
private void beforeAsync(Object target, Object[] args) {
((AsyncStartFlagFieldAccessor) args[1])._$PINPOINT$_setAsyncStartFlag(true);
final AsyncContext asyncContext = AsyncContextAccessorUtils.getAsyncContext(args, 1);
if (asyncContext == null) {
logger.debug("AsyncContext not found");
return;
}
final Trace trace = getAsyncTrace(asyncContext);
if (trace == null) {
return;
}
// entry scope.
entryAsyncTraceScope(trace);
try {
// trace event for default & async.
final SpanEventRecorder recorder = trace.traceBlockBegin();
doInBeforeTrace(recorder, trace, target, args);
} catch (Throwable th) {
if (logger.isWarnEnabled()) {
logger.warn("BEFORE. Caused:{}", th.getMessage(), th);
}
}
}
Aggregations