Package org.mule.api.transport

Examples of org.mule.api.transport.MessageDispatcher


    }

    public Object makeObject(Object key) throws Exception
    {
        OutboundEndpoint endpoint = (OutboundEndpoint) key;
        MessageDispatcher dispatcher = factory.create(endpoint);
        applyLifecycle(dispatcher);
        return dispatcher;
    }
View Full Code Here


    public void testDispatcherFullLifecycle() throws Exception
    {
        OutboundEndpoint out = getTestOutboundEndpoint("out", "test://out", null, null, null, connector);

        MessageDispatcher dispatcher = connector.getDispatcherFactory().create(out);
        dispatcher.initialise();
       
        assertTrue(dispatcher.getLifecycleState().isInitialised());
        dispatcher.connect();
        assertTrue(dispatcher.isConnected());

        dispatcher.start();
        assertTrue(dispatcher.getLifecycleState().isStarted());

        dispatcher.stop();
        assertTrue(dispatcher.getLifecycleState().isStopped());

        dispatcher.disconnect();
        assertFalse(dispatcher.isConnected());

        dispatcher.dispose();
        assertTrue(dispatcher.getLifecycleState().isDisposed());

    }
View Full Code Here

        {
            throw new IllegalArgumentException(CoreMessages.connectorSchemeIncompatibleWithEndpointScheme(
                    this.getProtocol(), endpoint.getEndpointURI().toString()).getMessage());
        }

        MessageDispatcher dispatcher = null;
        try
        {
            if (logger.isDebugEnabled())
            {
                logger.debug("Borrowing a dispatcher for endpoint: " + endpoint.getEndpointURI());
            }

            dispatcher = (MessageDispatcher) dispatchers.borrowObject(endpoint);

            if (logger.isDebugEnabled())
            {
                logger.debug("Borrowed a dispatcher for endpoint: " + endpoint.getEndpointURI() + " = "
                        + dispatcher.toString());
            }

            return dispatcher;
        }
        catch (Exception ex)
View Full Code Here

           this.endpoint = endpoint;
        }
       
        public MuleEvent process(MuleEvent event) throws MuleException
        {
            MessageDispatcher dispatcher = null;
            try
            {
                dispatcher = getDispatcher(endpoint);
                MuleEvent result = dispatcher.process(event);
                // We need to invoke notification message processor with request
                // message only after successful send/dispatch
                if (notificationMessageProcessor == null)
                {
                    notificationMessageProcessor = new OutboundNotificationMessageProcessor(endpoint);
View Full Code Here

        {
            public void run()
            {
                try
                {
                    MessageDispatcher messageDispatcher = (MessageDispatcher) connector.dispatchers.borrowObject(endpoint);
                    Thread.sleep(50);
                    connector.dispatchers.returnObject(endpoint, messageDispatcher);
                }
                catch (Exception e)
                {
View Full Code Here

        {
            public void run()
            {
                try
                {
                    MessageDispatcher messageDispatcher = (MessageDispatcher) connector.dispatchers.borrowObject(endpoint);
                    Thread.sleep(200);
                    connector.dispatchers.returnObject(endpoint, messageDispatcher);
                }
                catch (Exception e)
                {
View Full Code Here

        {
            public void run()
            {
                try
                {
                    MessageDispatcher messageDispatcher = (MessageDispatcher) connector.dispatchers.borrowObject(endpoint);
                    Thread.sleep(50);
                    connector.dispatchers.returnObject(endpoint, messageDispatcher);
                }
                catch (Exception e)
                {
View Full Code Here

        {
            public void run()
            {
                try
                {
                    MessageDispatcher messageDispatcher = (MessageDispatcher) connector.dispatchers.borrowObject(endpoint);
                    Thread.sleep(200);
                    connector.dispatchers.returnObject(endpoint, messageDispatcher);
                }
                catch (Exception e)
                {
View Full Code Here

    }

    public Object makeObject(Object key) throws Exception
    {
        OutboundEndpoint endpoint = (OutboundEndpoint) key;
        MessageDispatcher dispatcher = factory.create(endpoint);
        applyLifecycle(dispatcher);
        return dispatcher;
    }
View Full Code Here

        }

        @Override
        public MuleEvent process(MuleEvent event) throws MuleException
        {
            MessageDispatcher dispatcher = null;
            try
            {
                dispatcher = borrowDispatcher(endpoint);
                boolean fireNotification = event.isNotificationsEnabled();
                EndpointMessageNotification beginNotification = null;
                if (fireNotification)
                {
                    if (notificationMessageProcessor == null)
                    {
                        notificationMessageProcessor = new OutboundNotificationMessageProcessor(endpoint);
                    }
                    beginNotification = notificationMessageProcessor.createBeginNotification(event);
                }
                MuleEvent result = dispatcher.process(event);

                if (fireNotification)
                {
                    // We need to invoke notification message processor with request
                    // message only after successful send/dispatch
View Full Code Here

TOP

Related Classes of org.mule.api.transport.MessageDispatcher

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.