Package org.mule.api.transport

Examples of org.mule.api.transport.MessageRequester


    public void testRequesterFullLifecycle() throws Exception
    {
        InboundEndpoint in = getTestInboundEndpoint("out", "test://out", null, null, null, connector);

        MessageRequester requester = connector.getRequesterFactory().create(in);

        requester.initialise();
        assertTrue(requester.getLifecycleState().isInitialised());

        requester.connect();
        assertTrue(requester.isConnected());

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

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

        requester.disconnect();
        assertFalse(requester.isConnected());

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

    }
View Full Code Here


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

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

            requester = (MessageRequester) requesters.borrowObject(endpoint);

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

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

                timeout);
    }

    public MuleMessage request(InboundEndpoint endpoint, long timeout) throws Exception
    {
        MessageRequester requester = null;
        MuleMessage result = null;

        try
        {
            requester = this.getRequester(endpoint);
            result = requester.request(timeout);
            return result;
        }
        finally
        {
            setupRequestReturn(endpoint, requester, result);
View Full Code Here

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

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

            requester = (MessageRequester) requesters.borrowObject(endpoint);

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

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

    }

    @Override
    public MuleMessage request(InboundEndpoint endpoint, long timeout) throws Exception
    {
        MessageRequester requester = null;
        MuleMessage result = null;

        try
        {
            requester = this.getRequester(endpoint);
            result = requester.request(timeout);
            return result;
        }
        finally
        {
            setupRequestReturn(endpoint, requester, result);
View Full Code Here

    @Test
    public void testRequesterFullLifecycle() throws Exception
    {
        InboundEndpoint in = getTestInboundEndpoint("out", "test://out", null, null, null, connector);

        MessageRequester requester = connector.getRequesterFactory().create(in);

        requester.initialise();
        assertTrue(requester.getLifecycleState().isInitialised());

        requester.connect();
        assertTrue(requester.isConnected());

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

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

        requester.disconnect();
        assertFalse(requester.isConnected());

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

    }
View Full Code Here

TOP

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

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.