Example usage for com.rabbitmq.client.impl.nio SocketChannelFrameHandler getPort

List of usage examples for com.rabbitmq.client.impl.nio SocketChannelFrameHandler getPort

Introduction

In this page you can find the example usage for com.rabbitmq.client.impl.nio SocketChannelFrameHandler getPort.

Prototype

@Override
    public int getPort() 

Source Link

Usage

From source file:com.navercorp.pinpoint.plugin.rabbitmq.client.interceptor.SocketChannelFrameHandlerConstructInterceptor.java

License:Apache License

@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
    if (!validate(target)) {
        return;/*from  ww w  .j av a  2  s  .c  om*/
    }
    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);
}