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());