Search in sources :

Example 1 with TransportGetter

use of com.navercorp.pinpoint.plugin.activemq.client.field.getter.TransportGetter in project pinpoint by naver.

the class ActiveMQMessageConsumerDispatchInterceptor method validateTransport.

private boolean validateTransport(ActiveMQSession session) {
    if (session == null) {
        return false;
    }
    ActiveMQConnection connection = session.getConnection();
    if (!(connection instanceof TransportGetter)) {
        if (isDebug) {
            logger.debug("Invalid connection object. Need field accessor({}).", TransportGetter.class.getName());
        }
        return false;
    }
    Transport transport = getRootTransport(((TransportGetter) connection)._$PINPOINT$_getTransport());
    if (!(transport instanceof SocketGetter)) {
        if (isDebug) {
            logger.debug("Transport not traceable({}).", transport.getClass().getName());
        }
        return false;
    }
    return true;
}
Also used : SocketGetter(com.navercorp.pinpoint.plugin.activemq.client.field.getter.SocketGetter) ActiveMQConnection(org.apache.activemq.ActiveMQConnection) TransportGetter(com.navercorp.pinpoint.plugin.activemq.client.field.getter.TransportGetter) Transport(org.apache.activemq.transport.Transport)

Example 2 with TransportGetter

use of com.navercorp.pinpoint.plugin.activemq.client.field.getter.TransportGetter in project pinpoint by naver.

the class ActiveMQMessageProducerSendInterceptor method validateTransport.

private boolean validateTransport(ActiveMQSession session) {
    if (session == null) {
        return false;
    }
    ActiveMQConnection connection = session.getConnection();
    if (!(connection instanceof TransportGetter)) {
        if (isDebug) {
            logger.debug("Invalid connection object. Need field accessor({}).", TransportGetter.class.getName());
        }
        return false;
    }
    Transport transport = getRootTransport(((TransportGetter) connection)._$PINPOINT$_getTransport());
    if (!(transport instanceof SocketGetter)) {
        if (isDebug) {
            logger.debug("Transport not traceable({}).", transport.getClass().getName());
        }
        return false;
    }
    return true;
}
Also used : SocketGetter(com.navercorp.pinpoint.plugin.activemq.client.field.getter.SocketGetter) ActiveMQConnection(org.apache.activemq.ActiveMQConnection) TransportGetter(com.navercorp.pinpoint.plugin.activemq.client.field.getter.TransportGetter) Transport(org.apache.activemq.transport.Transport)

Aggregations

SocketGetter (com.navercorp.pinpoint.plugin.activemq.client.field.getter.SocketGetter)2 TransportGetter (com.navercorp.pinpoint.plugin.activemq.client.field.getter.TransportGetter)2 ActiveMQConnection (org.apache.activemq.ActiveMQConnection)2 Transport (org.apache.activemq.transport.Transport)2