Search in sources :

Example 6 with SocketFieldAccessor

use of com.navercorp.pinpoint.plugin.thrift.field.accessor.SocketFieldAccessor in project pinpoint by naver.

the class TNonblockingSocketConstructInterceptor method after.

@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
    if (isDebug) {
        logger.afterInterceptor(target, args, result, throwable);
    }
    if (validate(target, args)) {
        Socket socket = ((TNonblockingSocket) target).getSocketChannel().socket();
        ((SocketFieldAccessor) target)._$PINPOINT$_setSocket(socket);
        if (args[2] instanceof SocketAddress) {
            SocketAddress socketAddress = (SocketAddress) args[2];
            ((SocketAddressFieldAccessor) target)._$PINPOINT$_setSocketAddress(socketAddress);
        }
    }
}
Also used : SocketAddressFieldAccessor(com.navercorp.pinpoint.plugin.thrift.field.accessor.SocketAddressFieldAccessor) SocketFieldAccessor(com.navercorp.pinpoint.plugin.thrift.field.accessor.SocketFieldAccessor) SocketAddress(java.net.SocketAddress) Socket(java.net.Socket) TNonblockingSocket(org.apache.thrift.transport.TNonblockingSocket)

Aggregations

SocketFieldAccessor (com.navercorp.pinpoint.plugin.thrift.field.accessor.SocketFieldAccessor)6 Socket (java.net.Socket)6 TTransport (org.apache.thrift.transport.TTransport)3 SpanEventRecorder (com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder)2 TProtocol (org.apache.thrift.protocol.TProtocol)2 SpanRecorder (com.navercorp.pinpoint.bootstrap.context.SpanRecorder)1 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)1 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)1 InterceptorScopeInvocation (com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation)1 ThriftRequestProperty (com.navercorp.pinpoint.plugin.thrift.ThriftRequestProperty)1 SocketAddressFieldAccessor (com.navercorp.pinpoint.plugin.thrift.field.accessor.SocketAddressFieldAccessor)1 SocketAddress (java.net.SocketAddress)1 TServiceClient (org.apache.thrift.TServiceClient)1 TNonblockingSocket (org.apache.thrift.transport.TNonblockingSocket)1 TSocket (org.apache.thrift.transport.TSocket)1