Package org.apache.camel.component.file.strategy

Examples of org.apache.camel.component.file.strategy.FileProcessStrategy


                    }
                    return;
                }
            }

            FileProcessStrategy processStrategy = endpoint.getFileStrategy();
            FileExchange exchange = endpoint.createExchange(file);

            try {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("About to process file:  " + file + " using exchange: " + exchange);
                }
                if (processStrategy.begin(endpoint, exchange, file)) {
                    getProcessor().process(exchange);
                    processStrategy.commit(endpoint, exchange, file);
                }
                else {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug(endpoint + " cannot process file: " + file);
                    }
View Full Code Here


                return 1;
            }
            filesBeingProcessed.put(file, file);
        }

        final FileProcessStrategy processStrategy = endpoint.getFileStrategy();
        final FileExchange exchange = endpoint.createExchange(file);

        endpoint.configureMessage(file, exchange.getIn());
        try {
            if (LOG.isDebugEnabled()) {
                LOG.debug("About to process file:  " + file + " using exchange: " + exchange);
            }
            if (processStrategy.begin(endpoint, exchange, file)) {
               
                // Use the async processor interface so that processing of
                // the
                // exchange can happen asynchronously
                getAsyncProcessor().process(exchange, new AsyncCallback() {
                    public void done(boolean sync) {
                        if (exchange.getException() == null) {
                            try {
                                processStrategy.commit(endpoint, (FileExchange)exchange, file);
                            } catch (Exception e) {
                                handleException(e);
                            }
                        } else {
                            handleException(exchange.getException());
View Full Code Here

TOP

Related Classes of org.apache.camel.component.file.strategy.FileProcessStrategy

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.