Package org.apache.camel

Examples of org.apache.camel.Endpoint.createConsumer()


     * such as adding the processor or consumer
     */
    @Override
    protected void addServices(List<Service> services) throws Exception {
        Endpoint endpoint = getEndpoint();
        consumer = endpoint.createConsumer(processor);
        if (consumer != null) {
            services.add(consumer);
        }
        Processor processor = getProcessor();
        if (processor instanceof Service) {
View Full Code Here


        String injectionPointName = method.getName();
        Endpoint endpoint = getEndpointInjection(endpointUri, endpointName, injectionPointName, true);
        if (endpoint != null) {
            try {
                Processor processor = createConsumerProcessor(bean, method, endpoint);
                Consumer consumer = endpoint.createConsumer(processor);
                LOG.debug("Created processor: {} for consumer: {}", processor, consumer);
                startService(consumer, bean, beanName);
            } catch (Exception e) {
                throw ObjectHelper.wrapRuntimeCamelException(e);
            }
View Full Code Here

    public void testCreateDirectory() throws Exception {
        deleteDirectory("target/file/foo");

        Endpoint endpoint = context.getEndpoint("file://target/file/foo");
        Consumer consumer = endpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });
View Full Code Here

        deleteDirectory("target/file/foo");
        // use current dir as base as absolute path
        String base = new File("").getAbsolutePath() + "/target/file/foo";

        Endpoint endpoint = context.getEndpoint("file://" + base);
        Consumer consumer = endpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });
View Full Code Here

    public void testDoNotCreateDirectory() throws Exception {
        deleteDirectory("target/file/foo");

        Endpoint endpoint = context.getEndpoint("file://target/file/foo?autoCreate=false");
        Consumer consumer = endpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });
View Full Code Here

    public void testAutoCreateDirectoryWithDot() throws Exception {
        deleteDirectory("target/file/foo.bar");

        Endpoint endpoint = context.getEndpoint("file://target/file/foo.bar?autoCreate=true");
        Consumer consumer = endpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                // noop
            }
        });
View Full Code Here

    public void testStartingDirectoryMustExistDirectory() throws Exception {
        deleteDirectory("target/file/foo");

        Endpoint endpoint = context.getEndpoint("file://target/file/foo?autoCreate=false&startingDirectoryMustExist=true");
        try {
            endpoint.createConsumer(new Processor() {
                public void process(Exchange exchange) throws Exception {
                    // noop
                }
            });
            fail("Should have thrown an exception");
View Full Code Here

     * such as adding the processor or consumer
     */
    @Override
    protected void addServices(List<Service> services) throws Exception {
        Endpoint endpoint = getEndpoint();
        consumer = endpoint.createConsumer(processor);
        if (consumer != null) {
            services.add(consumer);
        }
        Processor processor = getProcessor();
        if (processor instanceof Service) {
View Full Code Here

        Endpoint endpoint = CamelContextHelper.getMandatoryEndpoint(camelContext, uri);
        notNull(camelContext, "service");
        Object proxy = getProxyForService();

        consumer = endpoint.createConsumer(new BeanProcessor(proxy, camelContext));
        consumer.start();
    }

    public void destroy() throws Exception {
        if (consumer != null) {
View Full Code Here

    private void bindToRegistry(JndiRegistry jndi) throws Exception {
        Component comp = new DirectComponent();
        comp.setCamelContext(context);

        Endpoint slow = comp.createEndpoint("direct:somename");
        Consumer consumer = slow.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                template.send("mock:result", exchange);
            }
        });
        consumer.start();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.