Package org.mule.api.endpoint

Examples of org.mule.api.endpoint.EndpointBuilder


        }
        message.addProperties(messageProperties, PropertyScope.INBOUND);
        message.addProperties(messageProperties, PropertyScope.INVOCATION);

        //TODO should probably cache this
        EndpointBuilder endpointBuilder = muleContext.getEndpointFactory().getEndpointBuilder(endpoint);
        endpointBuilder.setExchangePattern(exchangePattern);
        OutboundEndpoint ep = endpointBuilder.buildOutboundEndpoint();
      
        DefaultMuleEvent event = new DefaultMuleEvent(message, ep.getExchangePattern(),
            new DefaultMuleSession(flowConstruct, muleContext));

        RequestContext.setEvent(event);
View Full Code Here


        // MuleContext must be started explicitly after MULE-1988
        assertFalse(context.isStarted());
        context.start();
        assertTrue(context.isStarted());

        final EndpointBuilder endpoint = context.getRegistry().lookupEndpointBuilder("endpoint");
        assertNotNull(endpoint);
        assertEquals("test://value", endpoint.buildInboundEndpoint().getEndpointURI().toString());
    }
View Full Code Here

    public Transformer getTransformer() throws Exception
    {
        Transformer trans = createObject(StringToObjectArray.class);
        trans.setReturnDataType(DataTypeFactory.create(Object[].class));

        EndpointBuilder builder = new EndpointURIEndpointBuilder("test://test", muleContext);
        builder.setEncoding(encoding);
        ImmutableEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint(
            builder);
        trans.setEndpoint(endpoint);

        return trans;
View Full Code Here

        assertEquals("text/xml", inbound.getMimeType());
        assertEquals("utf-8", inbound.getEncoding());
        OutboundEndpoint outbound = muleContext.getRegistry().lookupObject("outbound");
        assertEquals("application/json", outbound.getMimeType());
        assertEquals("iso-8859-2", outbound.getEncoding());
        EndpointBuilder global = muleContext.getRegistry().lookupEndpointBuilder("global");
        InboundEndpoint created = global.buildInboundEndpoint();
        assertEquals("application/xml", created.getMimeType());
        assertEquals("iso-8859-1", created.getEncoding());
    }
View Full Code Here

        List<Transformer> transformers = new ArrayList<Transformer>();
        transformers.add(trans1);
        transformers.add(trans2);

        Filter filter = new PayloadTypeFilter(Object.class);
        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder("test://serializationTest",
            muleContext);
        endpointBuilder.setTransformers(transformers);
        endpointBuilder.setName("epBuilderTest");
        endpointBuilder.addMessageProcessor(new MessageFilter(filter));
        muleContext.getRegistry().registerEndpointBuilder("epBuilderTest", endpointBuilder);

        getTestService();
    }
View Full Code Here

            {
                transformer = new FileMessageFactoryAssertingTransformer(byte[].class);
            }
        }
       
        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(url, muleContext);
        endpointBuilder.addMessageProcessor(transformer);
        if (filePayload)
        {
            endpointBuilder.addMessageProcessor(new NoActionTransformer());
        }
        InboundEndpoint endpoint =
            muleContext.getEndpointFactory().getInboundEndpoint(endpointBuilder);
        ((CompositeMessageSource) service.getMessageSource()).addSource(endpoint);
       
View Full Code Here

        tempUrl = urlBuffer.toString();
        logger.info("Invoking REST service: " + tempUrl);

        event.getMessage().setOutboundProperty(HttpConnector.HTTP_METHOD_PROPERTY, httpMethod);

        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(tempUrl, muleContext);
        endpointBuilder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE);
        OutboundEndpoint outboundEndpoint = endpointBuilder.buildOutboundEndpoint();

        MuleEventContext eventContext = new DefaultMuleEventContext(event);
        result = eventContext.sendEvent(
            new DefaultMuleMessage(requestBody, event.getMessage(), muleContext), outboundEndpoint);
        if (isErrorPayload(result))
View Full Code Here

        // do nothing
    }
   
    public void testSmtpDoesNotSupportOutboundEndpoints() throws MuleException
    {
        EndpointBuilder builder = new EndpointURIEndpointBuilder(getTestEndpointURI(), muleContext);
        builder.setName("test");

        try
        {
            muleContext.getEndpointFactory().getInboundEndpoint(builder);
            fail("Inbound SMTP endpoints are not supported");
View Full Code Here

        FileConnector c = (FileConnector) muleContext.getRegistry().lookupConnector("fileConnector2");
        assertNotNull(c);
        assertNotNull(c.getServiceOverrides());

        EndpointBuilder builder = new EndpointURIEndpointBuilder("file:///temp?connector=fileConnector1",
            muleContext);
        builder.setConnector(c);
        endpoint = muleContext.getEndpointFactory().getInboundEndpoint(builder);
        assertNotNull(((AbstractConnector) endpoint.getConnector()).getServiceOverrides());

        EndpointBuilder builder2 = new EndpointURIEndpointBuilder("file:///temp?connector=fileConnector3",
            muleContext);
        builder.setConnector(c);
        endpoint = muleContext.getEndpointFactory().getInboundEndpoint(builder2);
        assertNull(((AbstractConnector) endpoint.getConnector()).getServiceOverrides());

        EndpointBuilder builder3 = new EndpointURIEndpointBuilder("file:///temp?connector=fileConnector2",
            muleContext);
        builder.setConnector(c);
        endpoint = muleContext.getEndpointFactory().getInboundEndpoint(builder3);
        assertNotNull(((AbstractConnector) endpoint.getConnector()).getServiceOverrides());
View Full Code Here

    public InboundEndpoint getEndpoint() throws Exception
    {
        UdpConnector connector = new UdpConnector(muleContext);
        connector.initialise();
       
        EndpointBuilder builder = new EndpointURIEndpointBuilder("udp://localhost:10100", muleContext);
        builder.setConnector(connector);
        return muleContext.getEndpointFactory().getInboundEndpoint(builder);
    }
View Full Code Here

TOP

Related Classes of org.mule.api.endpoint.EndpointBuilder

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.