Package org.mule.api.transport

Examples of org.mule.api.transport.MessageDispatcher


        {
            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


    @Test
    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

        message.setProperty("keyNonSerializable", nonSerializable, PropertyScope.SESSION);
        message.setProperty("keyNonSerializable2", nonSerializable, PropertyScope.SESSION);
        message.setProperty("key", "value", PropertyScope.SESSION);
        message.setProperty("key2", "value2", PropertyScope.SESSION);

        MessageDispatcher dispatcher = new VMMessageDispatcher(muleContext.getEndpointFactory()
            .getOutboundEndpoint("addSessionPropertiesFlowEndpoint"));
        MuleEvent result = dispatcher.process(event);

        assertNotNull(result);
        assertNotSame(event, result);
        assertEquals("val", result.getSession().getProperty("keyNonSerializable"));
        assertEquals(nonSerializable, result.getSession().getProperty("keyNonSerializable2"));
View Full Code Here

    {
        if (singleDispatcherPerEndpoint)
        {
            // Avoid lazy initialization of dispatcher in borrow method which would be less performant by
            // creating the dispatcher instance when DispatcherMessageProcessor is created.
            MessageDispatcher dispatcher = dispatcherFactory.create(endpoint);
            applyDispatcherLifecycle(dispatcher);
            endpointDispatchers.put(endpoint, dispatcher);
        }
        return super.createDispatcherMessageProcessor(endpoint);
    }
View Full Code Here

    {
        if (!useDispatcherPool)
        {
            // Avoid lazy initialization of dispatcher in borrow method which would be less performant by
            // creating the dispatcher instance when DispatcherMessageProcessor is created.
            MessageDispatcher dispatcher = dispatcherFactory.create(endpoint);
            applyDispatcherLifecycle(dispatcher);
            endpointDispatchers.put(endpoint, dispatcher);
        }
        return super.createDispatcherMessageProcessor(endpoint);
    }
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.