Package org.apache.camel.impl

Examples of org.apache.camel.impl.ProcessorEndpoint


*/
public class BeanComponentCustomCreateEndpointTest extends ContextTestSupport {

    public void testCreateEndpoint() throws Exception {
        BeanComponent bc = context.getComponent("bean", BeanComponent.class);
        ProcessorEndpoint pe = bc.createEndpoint(new MyFooBean());
        assertNotNull(pe);

        String uri = pe.getEndpointUri();
        assertEquals("bean:generated:MyFooBean", uri);

        Producer producer = pe.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("World");

        producer.start();
        producer.process(exchange);
View Full Code Here


        assertEquals("Hello World", exchange.getOut().getBody());
    }

    public void testCreateEndpointUri() throws Exception {
        BeanComponent bc = context.getComponent("bean", BeanComponent.class);
        ProcessorEndpoint pe = bc.createEndpoint(new MyFooBean(), "cheese");
        assertNotNull(pe);

        String uri = pe.getEndpointUri();
        assertEquals("cheese", uri);

        Producer producer = pe.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("World");

        producer.start();
        producer.process(exchange);
View Full Code Here

*/
public class BeanComponentCustomCreateEndpointTest extends ContextTestSupport {

    public void testCreateEndpoint() throws Exception {
        BeanComponent bc = context.getComponent("bean", BeanComponent.class);
        ProcessorEndpoint pe = bc.createEndpoint(new MyFooBean());
        assertNotNull(pe);

        String uri = pe.getEndpointUri();
        assertEquals("bean:generated:MyFooBean", uri);

        Producer producer = pe.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("World");

        producer.start();
        producer.process(exchange);
View Full Code Here

        assertEquals("Hello World", exchange.getOut().getBody());
    }

    public void testCreateEndpointUri() throws Exception {
        BeanComponent bc = context.getComponent("bean", BeanComponent.class);
        ProcessorEndpoint pe = bc.createEndpoint(new MyFooBean(), "cheese");
        assertNotNull(pe);

        String uri = pe.getEndpointUri();
        assertEquals("cheese", uri);

        Producer producer = pe.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("World");

        producer.start();
        producer.process(exchange);
View Full Code Here

        validator.setSchemaResource(resource);
        if (log.isDebugEnabled()) {
            log.debug(this + " using schema resource: " + resource);
        }
        configureValidator(validator, uri, remaining, parameters);
        return new ProcessorEndpoint(uri, this, validator);
    }
View Full Code Here

        loadResource(xslt, resource);

        // default to use the cache option from the component if the endpoint did not have the contentCache parameter
        boolean cache = getAndRemoveParameter(parameters, "contentCache", Boolean.class, contentCache);
        if (!cache) {
            return new ProcessorEndpoint(uri, this, xslt) {
                @Override
                protected void onExchange(Exchange exchange) throws Exception {
                    // force to load the resource on each exchange as we are not cached
                    loadResource(xslt, resource);
                    super.onExchange(exchange);
                }
            };
        } else {
            // we have already loaded xslt so we are cached
            return new ProcessorEndpoint(uri, this, xslt);
        }
    }
View Full Code Here

        if (endpoint != null) {
            endpoint.setCamelContext(this);
            return endpoint;
        }

        return new ProcessorEndpoint(uri, this, new BeanProcessor(bean, this));
    }
View Full Code Here

        // force loading of schema at create time otherwise concurrent processing could
        // cause thread safe issues for the javax.xml.validation.SchemaFactory
        validator.loadSchema();

        return new ProcessorEndpoint(uri, this, validator);
    }
View Full Code Here

        testTransformerFactory = TransformerFactory.newInstance();
       
        registry.bind("testConverter", testConverter);
        registry.bind("testTransformerFactory", testTransformerFactory);
       
        ProcessorEndpoint pep1 = (ProcessorEndpoint)context.getEndpoint(TEST_URI_1);
        ProcessorEndpoint pep2 = (ProcessorEndpoint)context.getEndpoint(TEST_URI_2);
       
        builder1 = (XsltBuilder)pep1.getProcessor();
        builder2 = (XsltBuilder)pep2.getProcessor();
       
        context.addRoutes(builder);
        context.start();
    }
View Full Code Here

        JingValidator validator = new JingValidator();
        Resource resource = resolveMandatoryResource(remaining);
        validator.setSchemaResource(resource);
        log.debug("{} using schema resource: {}", this, resource);
        configureValidator(validator, uri, remaining, parameters);
        return new ProcessorEndpoint(uri, this, validator);
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.impl.ProcessorEndpoint

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.