Package org.apache.camel.impl

Examples of org.apache.camel.impl.DefaultProducer


    protected CamelContext createCamelContext() throws Exception {
        CamelContext context = super.createCamelContext();

        context.addEndpoint("fail", new DefaultEndpoint() {
            public Producer createProducer() throws Exception {
                return new DefaultProducer(this) {
                    public void process(Exchange exchange) throws Exception {
                        exchange.setException(new IllegalArgumentException("Damn"));
                    }
                };
            }

            public Consumer createConsumer(Processor processor) throws Exception {
                return null;
            }

            @Override
            protected String createEndpointUri() {
                return "fail";
            }

            public boolean isSingleton() {
                return true;
            }
        });

        context.addEndpoint("not-fail", new DefaultEndpoint() {
            public Producer createProducer() throws Exception {
                return new DefaultProducer(this) {
                    public void process(Exchange exchange) throws Exception {
                        // noop
                    }
                };
            }
View Full Code Here


        return true;
    }

    public Producer createProducer() throws Exception {
        ObjectHelper.notNull(applicationContext, "applicationContext");
        return new DefaultProducer(this) {
            public void process(Exchange exchange) throws Exception {
                ApplicationEvent event = toApplicationEvent(exchange);
                applicationContext.publishEvent(event);
            }
        };
View Full Code Here

    public Consumer createConsumer(Processor processor) throws Exception {
        throw new UnsupportedOperationException("You cannot consume from this endpoint");
    }

    public Producer createProducer() throws Exception {
        return new DefaultProducer(this) {
            public void process(Exchange exchange) {
                onExchange(exchange);
            }
        };
    }
View Full Code Here

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.removePropertyChangeListener(listener);
    }

    public Producer createProducer() throws Exception {
        return new DefaultProducer(this) {
            public void process(Exchange exchange) throws Exception {
                onExchange(exchange);
            }
        };
    }
View Full Code Here

                }
            });
        }

        public Producer createProducer() throws Exception {
            return new DefaultProducer(this) {
                public void process(final Exchange exchange) throws Exception {
                    executor.execute(new Runnable() {
                        public void run() {
                            try {
                                tradeExecutor.execute(exchange.getIn().getMandatoryBody(Message.class));
View Full Code Here

    public Consumer createConsumer(Processor processor) throws Exception {
        throw new UnsupportedOperationException();
    }

    public Producer createProducer() throws Exception {
        return new DefaultProducer(this) {
            public void process(Exchange exchange) throws Exception {
                String dnsName = exchange.getIn().getHeader(DnsConstants.DNS_NAME, String.class);
                ObjectHelper.notEmpty(dnsName, "Header " + DnsConstants.DNS_NAME);

                Object type = exchange.getIn().getHeader(DnsConstants.DNS_TYPE);
View Full Code Here

    public Consumer createConsumer(Processor processor) throws Exception {
        throw new UnsupportedOperationException("You cannot consume from this endpoint");
    }

    public Producer createProducer() throws Exception {
        return new DefaultProducer(this) {
            public void process(Exchange exchange) {
                onExchange(exchange);
            }
        };
    }
View Full Code Here

        }
        return exchanges;
    }

    public Producer createProducer() throws Exception {
        return new DefaultProducer(this) {
            public void process(Exchange exchange) throws Exception {
                onExchange(exchange);
            }
        };
    }
View Full Code Here

        super(uri, component);
        this.queue = component.createQueue();
    }

    public Producer<E> createProducer() throws Exception {
        return new DefaultProducer(this) {
            public void process(Exchange exchange) {
                queue.add(toExchangeType(exchange));
            }
        };
    }
View Full Code Here

    public DirectEndpoint(String uri, DirectComponent<E> component) {
        super(uri, component);
    }

    public Producer createProducer() throws Exception {
        return new DefaultProducer(this) {
            public void process(Exchange exchange) throws Exception {
              DirectEndpoint.this.process(exchange);
            }
        };     
    }
View Full Code Here

TOP

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

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.