Package org.mule.endpoint

Examples of org.mule.endpoint.EndpointURIEndpointBuilder


        if (logger.isDebugEnabled())
        {
            logger.debug("Modified endpoint with " + scheme + " scheme to " + endpoint);
        }

        EndpointBuilder serviceEndpointbuilder = new EndpointURIEndpointBuilder(endpoint, muleContext);
        serviceEndpointbuilder.setExchangePattern(receiver.getEndpoint().getExchangePattern());
        serviceEndpointbuilder.setName(ep.getScheme() + ":" + serviceName);
        // Set the transformers on the endpoint too
        serviceEndpointbuilder.setTransformers(receiver.getEndpoint().getTransformers().isEmpty() ? null
                                                                                                  : receiver.getEndpoint().getTransformers());
        serviceEndpointbuilder.setResponseTransformers(receiver.getEndpoint().getResponseTransformers().isEmpty() ? null
                                                                                                                 : receiver.getEndpoint().getResponseTransformers());
        // set the filter on the axis endpoint on the real receiver endpoint
        serviceEndpointbuilder.addMessageProcessor(new MessageFilter(receiver.getEndpoint().getFilter()));
        // set the Security filter on the axis endpoint on the real receiver
        // endpoint
        SecurityFilter securityFilter = receiver.getEndpoint().getSecurityFilter();
        if (securityFilter != null)
        {
            serviceEndpointbuilder.addMessageProcessor(new SecurityFilterMessageProcessor(securityFilter));
        }

        // TODO Do we really need to modify the existing receiver endpoint? What happens if we don't security,
        // filters and transformers will get invoked twice?
        AbstractEndpointBuilder receiverEndpointBuilder = new EndpointURIEndpointBuilder(receiver.getEndpoint());
        // Remove the Axis filter now

        List<MessageProcessor> procs = new ArrayList(receiverEndpointBuilder.getMessageProcessors());
        CollectionUtils.removeType(procs, MessageFilter.class);
        CollectionUtils.removeType(procs, SecurityFilterMessageProcessor.class);
        receiverEndpointBuilder.setMessageProcessors(procs);

        InboundEndpoint serviceEndpoint = muleContext.getRegistry()
            .lookupEndpointFactory()
            .getInboundEndpoint(serviceEndpointbuilder);
View Full Code Here


    public void testOutputAppendEndpointOverride() throws Exception
    {
        FileConnector connector = (FileConnector) getConnector();

        EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(new URIBuilder("file://foo", muleContext));
        OutboundEndpoint endpoint = endpointBuilder.buildOutboundEndpoint();

        // Endpoint wants String-typed properties
        endpoint.getProperties().put("outputAppend", "true");

        try
View Full Code Here

    public Transformer getTransformer() throws Exception
    {
        Transformer trans = createObject(DomDocumentToXml.class);
        trans.setReturnDataType(DataTypeFactory.STRING);

        EndpointBuilder builder = new EndpointURIEndpointBuilder("test://test", muleContext);
        builder.setEncoding("US-ASCII");
        ImmutableEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint(
            builder);

        trans.setEndpoint(endpoint);
        return trans;
View Full Code Here

    public Transformer getTransformer() throws Exception
    {
        Transformer trans = createObject(XmlToOutputHandler.class);
        trans.setReturnDataType(DataTypeFactory.create(OutputHandler.class));

        EndpointBuilder builder = new EndpointURIEndpointBuilder("test://test", muleContext);
        builder.setEncoding("UTF-8");
        ImmutableEndpoint endpoint =
            muleContext.getEndpointFactory().getInboundEndpoint(builder);

        trans.setEndpoint(endpoint);
        return trans;
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

    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

        {
            builder = muleContext.getRegistry().lookupEndpointBuilder(endpointUri.getEndpointName());
        }
        if (builder == null)
        {
            builder = new EndpointURIEndpointBuilder(new URIBuilder(endpointUri));
        }

        builder.setExchangePattern(MessageExchangePattern.REQUEST_RESPONSE);

        OutboundEndpoint endpoint = getMuleContext().getEndpointFactory().getOutboundEndpoint(builder);
View Full Code Here

        {
            builder = muleContext.getRegistry().lookupEndpointBuilder(endpointUri.getEndpointName());
        }
        if (builder == null)
        {
            builder = new EndpointURIEndpointBuilder(new URIBuilder(endpointUri));
        }

        builder.setExchangePattern(MessageExchangePattern.ONE_WAY);

        OutboundEndpoint endpoint = getMuleContext().getEndpointFactory().getOutboundEndpoint(builder);
View Full Code Here

    {
        EndpointBuilder builder = muleContext.getRegistry().lookupEndpointBuilder(endpointName);

        if (builder == null)
        {
            builder = new EndpointURIEndpointBuilder(new URIBuilder(endpointName, muleContext));
        }

        builder.setExchangePattern(MessageExchangePattern.ONE_WAY);

        OutboundEndpoint endpoint = getMuleContext().getEndpointFactory().getOutboundEndpoint(builder);
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

TOP

Related Classes of org.mule.endpoint.EndpointURIEndpointBuilder

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.