Package org.mule.context.notification

Examples of org.mule.context.notification.EndpointMessageNotification


    public MuleEvent process(MuleEvent event) throws MuleException
    {
        AbstractConnector connector = (AbstractConnector) endpoint.getConnector();
        if (connector.isEnableMessageEvents())
        {
            connector.fireNotification(new EndpointMessageNotification(event.getMessage(), endpoint,
                event.getFlowConstruct().getName(), EndpointMessageNotification.MESSAGE_RECEIVED));
        }

        return event;
    }
View Full Code Here


                {

                    // Only care about EndpointMessageNotification
                    if (notification instanceof EndpointMessageNotification)
                    {
                        EndpointMessageNotification endpointNotification = (EndpointMessageNotification) notification;

                        // Extract action and name of the endpoint
                        int action = endpointNotification.getAction();
                        String endpoint = endpointNotification.getEndpoint();

                        // If it is a dispatch event on our outbound endpoint then
                        // countdown the latch.
                        if ((action == MESSAGE_DISPATCHED || action == MESSAGE_SENT)
                            && endpoint.equals(p.getOutboundEndpoint()))
View Full Code Here

            applyResponseTransformers(resultEvent);
        }

        if (connector.isEnableMessageEvents() && endpoint.getExchangePattern().hasResponse())
        {
            connector.fireNotification(new EndpointMessageNotification(
                    resultEvent.getMessage(), endpoint, resultEvent
                            .getFlowConstruct().getName(),
                    EndpointMessageNotification.MESSAGE_RESPONSE));
        }
View Full Code Here

    private final Logger logger = LoggerFactory.getLogger(getClass());

    public void onNotification(ServerNotification notification)
    {

        EndpointMessageNotification endpointNotification;
        if (notification instanceof EndpointMessageNotification)
        {
            endpointNotification = (EndpointMessageNotification) notification;
        }
        else
        {
            logger.debug(
                "*** EndpointMessageNotificationTestListener RECEIVED UNKNOWN NOTIFICATION OF TYPE {}",
                notification.getClass().getName());
            return;
        }

        MuleMessage message = (MuleMessage) endpointNotification.getSource();
        String msgType = message.getPayload().getClass().getName();
        String correlationId = (String) message.getProperty("MULE_CORRELATION_ID", "?");
        // String endpointUri =
        // endpointNotification.getEndpoint().getEndpointURI().toString();
        String endpointName = endpointNotification.getEndpoint();
        String action = notification.getActionName();
        String resourceId = notification.getResourceIdentifier();
        String timestamp = new Date(notification.getTimestamp()).toString();

        if (logger.isDebugEnabled())
View Full Code Here

            }
            else
            {
                notificationAction = EndpointMessageNotification.MESSAGE_DISPATCHED;
            }
            connector.fireNotification(new EndpointMessageNotification(event.getMessage(), endpoint,
                component, notificationAction));
        }

        return event;
    }
View Full Code Here

                applyResponseTransformers(resultEvent);
            }

            if (connector.isEnableMessageEvents())
            {
                connector.fireNotification(new EndpointMessageNotification(resultEvent.getMessage(),
                                                                           endpoint, resultEvent.getFlowConstruct(), EndpointMessageNotification.MESSAGE_RESPONSE));
            }
            return resultEvent;
        }
        else
View Full Code Here

            }
            else
            {
                notificationAction = EndpointMessageNotification.MESSAGE_DISPATCH_END;
            }
            dispatchNotification(new EndpointMessageNotification(event.getMessage(), endpoint,
                    event.getFlowConstruct(), notificationAction));
        }

        return event;
    }
View Full Code Here

            }
            else
            {
                notificationAction = EndpointMessageNotification.MESSAGE_DISPATCH_BEGIN;
            }
            return new EndpointMessageNotification(event.getMessage(), endpoint, event.getFlowConstruct(), notificationAction);
        }

        return null;
    }
View Full Code Here

     */
    public final MuleMessage request(long timeout) throws Exception
    {
        try
        {
            EndpointMessageNotification beginNotification = null;
            if (connector.isEnableMessageEvents())
            {
                MuleMessage dummyMessage = new DefaultMuleMessage(NullPayload.getInstance(), endpoint.getMuleContext());
                beginNotification = new EndpointMessageNotification(dummyMessage, endpoint, null, EndpointMessageNotification.MESSAGE_REQUEST_BEGIN);
            }
            // Make sure we are connected
            connect();
            MuleMessage result = null;
            result = doRequest(timeout);
            if (result != null)
            {
                String rootId = result.getInboundProperty(MuleProperties.MULE_ROOT_MESSAGE_ID_PROPERTY);
                if (rootId != null)
                {
                    result.setMessageRootId(rootId);
                    result.removeProperty(MuleProperties.MULE_ROOT_MESSAGE_ID_PROPERTY, PropertyScope.INBOUND);
                }
                if (beginNotification != null)
                {
                    result.propagateRootId(beginNotification.getSource());
                }
                if (!endpoint.isDisableTransportTransformer())
                {
                    applyInboundTransformers(result);
                }
                if (beginNotification != null)
                {
                    connector.fireNotification(beginNotification);
                    connector.fireNotification(new EndpointMessageNotification(result, endpoint, null,
                        EndpointMessageNotification.MESSAGE_REQUEST_END));
                }
            }
            return result;
        }
View Full Code Here

            MessageDispatcher dispatcher = null;
            try
            {
                dispatcher = borrowDispatcher(endpoint);
                boolean fireNotification = event.isNotificationsEnabled();
                EndpointMessageNotification beginNotification = null;
                if (fireNotification)
                {
                    if (notificationMessageProcessor == null)
                    {
                        notificationMessageProcessor = new OutboundNotificationMessageProcessor(endpoint);
View Full Code Here

TOP

Related Classes of org.mule.context.notification.EndpointMessageNotification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.