Search in sources :

Example 1 with SocketAddressFieldAccessor

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

the class TAsyncMethodCallConstructInterceptor 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)) {
        TNonblockingTransport transport = ((TNonblockingTransportFieldGetter) target)._$PINPOINT$_getTNonblockingTransport();
        if (validateTransport(transport)) {
            SocketAddress socketAddress = ((SocketAddressFieldAccessor) transport)._$PINPOINT$_getSocketAddress();
            ((SocketAddressFieldAccessor) target)._$PINPOINT$_setSocketAddress(socketAddress);
        }
    }
}
Also used : SocketAddressFieldAccessor(com.navercorp.pinpoint.plugin.thrift.field.accessor.SocketAddressFieldAccessor) TNonblockingTransport(org.apache.thrift.transport.TNonblockingTransport) TNonblockingTransportFieldGetter(com.navercorp.pinpoint.plugin.thrift.field.getter.TNonblockingTransportFieldGetter) SocketAddress(java.net.SocketAddress)

Example 2 with SocketAddressFieldAccessor

use of com.navercorp.pinpoint.plugin.thrift.field.accessor.SocketAddressFieldAccessor 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

SocketAddressFieldAccessor (com.navercorp.pinpoint.plugin.thrift.field.accessor.SocketAddressFieldAccessor)2 SocketAddress (java.net.SocketAddress)2 SocketFieldAccessor (com.navercorp.pinpoint.plugin.thrift.field.accessor.SocketFieldAccessor)1 TNonblockingTransportFieldGetter (com.navercorp.pinpoint.plugin.thrift.field.getter.TNonblockingTransportFieldGetter)1 Socket (java.net.Socket)1 TNonblockingSocket (org.apache.thrift.transport.TNonblockingSocket)1 TNonblockingTransport (org.apache.thrift.transport.TNonblockingTransport)1