Package org.apache.camel.impl

Examples of org.apache.camel.impl.EventDrivenPollingConsumer


     * @param exchange the current exchange
     */
    protected void preCheckPoll(Exchange exchange) throws Exception {
        // cannot poll a file endpoint if already consuming from a file endpoint (CAMEL-1895)
        if (consumer instanceof EventDrivenPollingConsumer) {
            EventDrivenPollingConsumer edpc = (EventDrivenPollingConsumer) consumer;
            boolean fileBasedConsumer = edpc.getEndpoint().getEndpointKey().startsWith("file") || edpc.getEndpoint().getEndpointKey().startsWith("ftp");
            boolean fileBasedExchange = exchange.getFromEndpoint() != null
                    && (exchange.getFromEndpoint().getEndpointUri().startsWith("file") || exchange.getFromEndpoint().getEndpointUri().startsWith("ftp"));
            if (fileBasedConsumer && fileBasedExchange) {
                throw new IllegalArgumentException("Camel currently does not support pollEnrich from a file/ftp endpoint"
                        + " when the route also started from a file/ftp endpoint."
                        + " Started from: " + exchange.getFromEndpoint().getEndpointUri() + " pollEnrich: " + edpc.getEndpoint().getEndpointUri());
            }
        }
    }
View Full Code Here


     * @param exchange the current exchange
     */
    protected void preChceckPoll(Exchange exchange) throws Exception {
        // cannot poll a file endpoint if already consuming from a file endpoint (CAMEL-1895)
        if (consumer instanceof EventDrivenPollingConsumer) {
            EventDrivenPollingConsumer edpc = (EventDrivenPollingConsumer) consumer;
            boolean fileBasedConsumer = edpc.getEndpoint().getEndpointKey().startsWith("file") || edpc.getEndpoint().getEndpointKey().startsWith("ftp");
            boolean fileBasedExchange = exchange.getFromEndpoint() != null
                    && (exchange.getFromEndpoint().getEndpointUri().startsWith("file") || exchange.getFromEndpoint().getEndpointUri().startsWith("ftp"));
            if (fileBasedConsumer && fileBasedExchange) {
                throw new IllegalArgumentException("Camel currently does not support pollEnrich from a file/ftp endpoint"
                        + " when the route also started from a file/ftp endpoint."
                        + " Started from: " + exchange.getFromEndpoint().getEndpointUri() + " pollEnrich: " + edpc.getEndpoint().getEndpointUri());
            }
        }
    }
View Full Code Here

     * @param exchange the current exchange
     */
    protected void preChceckPoll(Exchange exchange) throws Exception {
        // cannot poll a file endpoint if already consuming from a file endpoint (CAMEL-1895)
        if (consumer instanceof EventDrivenPollingConsumer) {
            EventDrivenPollingConsumer edpc = (EventDrivenPollingConsumer) consumer;
            boolean fileBasedConsumer = edpc.getEndpoint().getEndpointKey().startsWith("file") || edpc.getEndpoint().getEndpointKey().startsWith("ftp");
            boolean fileBasedExchange = exchange.getFromEndpoint().getEndpointUri().startsWith("file") || exchange.getFromEndpoint().getEndpointUri().startsWith("ftp");
            if (fileBasedConsumer && fileBasedExchange) {
                throw new IllegalArgumentException("Camel durrently does not support pollEnrich from a file/ftp endpoint"
                        + " when the route also started from a file/ftp endpoint."
                        + " Started from: " + exchange.getFromEndpoint().getEndpointUri() + " pollEnrich: " + edpc.getEndpoint().getEndpointUri());
            }
        }
    }
View Full Code Here

     * @param exchange the current exchange
     */
    protected void preChceckPoll(Exchange exchange) throws Exception {
        // cannot poll a file endpoint if already consuming from a file endpoint (CAMEL-1895)
        if (consumer instanceof EventDrivenPollingConsumer) {
            EventDrivenPollingConsumer edpc = (EventDrivenPollingConsumer) consumer;
            boolean fileBasedConsumer = edpc.getEndpoint().getEndpointKey().startsWith("file") || edpc.getEndpoint().getEndpointKey().startsWith("ftp");
            boolean fileBasedExchange = exchange.getFromEndpoint().getEndpointUri().startsWith("file") || exchange.getFromEndpoint().getEndpointUri().startsWith("ftp");
            if (fileBasedConsumer && fileBasedExchange) {
                throw new IllegalArgumentException("Camel currently does not support pollEnrich from a file/ftp endpoint"
                        + " when the route also started from a file/ftp endpoint."
                        + " Started from: " + exchange.getFromEndpoint().getEndpointUri() + " pollEnrich: " + edpc.getEndpoint().getEndpointUri());
            }
        }
    }
View Full Code Here

     * @param exchange the current exchange
     */
    protected void preChceckPoll(Exchange exchange) throws Exception {
        // cannot poll a file endpoint if already consuming from a file endpoint (CAMEL-1895)
        if (consumer instanceof EventDrivenPollingConsumer) {
            EventDrivenPollingConsumer edpc = (EventDrivenPollingConsumer) consumer;
            boolean fileBasedConsumer = edpc.getEndpoint().getEndpointKey().startsWith("file") || edpc.getEndpoint().getEndpointKey().startsWith("ftp");
            boolean fileBasedExchange = exchange.getFromEndpoint().getEndpointUri().startsWith("file") || exchange.getFromEndpoint().getEndpointUri().startsWith("ftp");
            if (fileBasedConsumer && fileBasedExchange) {
                throw new IllegalArgumentException("Camel currently does not support pollEnrich from a file/ftp endpoint"
                        + " when the route also started from a file/ftp endpoint."
                        + " Started from: " + exchange.getFromEndpoint().getEndpointUri() + " pollEnrich: " + edpc.getEndpoint().getEndpointUri());
            }
        }
    }
View Full Code Here

        }
    }

    @Override
    public PollingConsumer createPollingConsumer() throws Exception {
        return new EventDrivenPollingConsumer(this);
    }
View Full Code Here

        return new HttpConsumer(this, processor);
    }

    @Override
    public PollingConsumer<HttpExchange> createPollingConsumer() throws Exception {
        return new EventDrivenPollingConsumer(this);
    }
View Full Code Here

TOP

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

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.