Search in sources :

Example 1 with SocketChannelFrameHandler

use of com.rabbitmq.client.impl.nio.SocketChannelFrameHandler in project pinpoint by naver.

the class SocketChannelFrameHandlerConstructInterceptor method after.

@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
    if (!validate(target)) {
        return;
    }
    String localAddress = RabbitMQClientConstants.UNKNOWN;
    String remoteAddress = RabbitMQClientConstants.UNKNOWN;
    if (target instanceof SocketChannelFrameHandler) {
        SocketChannelFrameHandler frameHandler = (SocketChannelFrameHandler) target;
        localAddress = HostAndPort.toHostAndPortString(frameHandler.getLocalAddress().getHostAddress(), frameHandler.getLocalPort());
        remoteAddress = HostAndPort.toHostAndPortString(frameHandler.getAddress().getHostAddress(), frameHandler.getPort());
    }
    ((LocalAddressAccessor) target)._$PINPOINT$_setLocalAddress(localAddress);
    ((RemoteAddressAccessor) target)._$PINPOINT$_setRemoteAddress(remoteAddress);
}
Also used : LocalAddressAccessor(com.navercorp.pinpoint.plugin.rabbitmq.client.field.accessor.LocalAddressAccessor) SocketChannelFrameHandler(com.rabbitmq.client.impl.nio.SocketChannelFrameHandler) RemoteAddressAccessor(com.navercorp.pinpoint.plugin.rabbitmq.client.field.accessor.RemoteAddressAccessor)

Aggregations

LocalAddressAccessor (com.navercorp.pinpoint.plugin.rabbitmq.client.field.accessor.LocalAddressAccessor)1 RemoteAddressAccessor (com.navercorp.pinpoint.plugin.rabbitmq.client.field.accessor.RemoteAddressAccessor)1 SocketChannelFrameHandler (com.rabbitmq.client.impl.nio.SocketChannelFrameHandler)1