Search in sources :

Example 1 with ActiveMQMessageConsumer

use of org.apache.activemq.ActiveMQMessageConsumer in project pinpoint by naver.

the class ActiveMQMessageConsumerDispatchInterceptor method validate.

private boolean validate(Object target, Object[] args) {
    if (!(target instanceof ActiveMQMessageConsumer)) {
        return false;
    }
    if (!(target instanceof ActiveMQSessionGetter)) {
        if (isDebug) {
            logger.debug("Invalid target object. Need field accessor({}).", ActiveMQSessionGetter.class.getName());
        }
        return false;
    }
    if (!validateTransport(((ActiveMQSessionGetter) target)._$PINPOINT$_getActiveMQSession())) {
        return false;
    }
    if (args == null || args.length < 1) {
        return false;
    }
    if (!(args[0] instanceof MessageDispatch)) {
        return false;
    }
    MessageDispatch md = (MessageDispatch) args[0];
    Message message = md.getMessage();
    if (!(message instanceof ActiveMQMessage)) {
        return false;
    }
    return true;
}
Also used : MessageDispatch(org.apache.activemq.command.MessageDispatch) ActiveMQSessionGetter(com.navercorp.pinpoint.plugin.activemq.client.field.getter.ActiveMQSessionGetter) ActiveMQMessage(org.apache.activemq.command.ActiveMQMessage) Message(org.apache.activemq.command.Message) ActiveMQMessageConsumer(org.apache.activemq.ActiveMQMessageConsumer) ActiveMQMessage(org.apache.activemq.command.ActiveMQMessage)

Aggregations

ActiveMQSessionGetter (com.navercorp.pinpoint.plugin.activemq.client.field.getter.ActiveMQSessionGetter)1 ActiveMQMessageConsumer (org.apache.activemq.ActiveMQMessageConsumer)1 ActiveMQMessage (org.apache.activemq.command.ActiveMQMessage)1 Message (org.apache.activemq.command.Message)1 MessageDispatch (org.apache.activemq.command.MessageDispatch)1