org.apache.camel.component.file
Interface FileProcessStrategy

All Known Implementing Classes:
DeleteFileProcessStrategy, FileProcessStrategySupport, NoOpFileProcessStrategy, RenameFileProcessStrategy

public interface FileProcessStrategy

Represents a strategy for marking that a file is processed.

Version:
$Revision: 1055 $

Method Summary
 boolean begin(FileEndpoint endpoint, FileExchange exchange, File file)
          Called when work is about to begin on this file.
 void commit(FileEndpoint endpoint, FileExchange exchange, File file)
          Releases any file locks and possibly deletes or moves the file after successful processing
 void rollback(FileEndpoint endpoint, FileExchange exchange, File file)
          Releases any file locks and possibly deletes or moves the file after unsuccessful processing
 

Method Detail

begin

boolean begin(FileEndpoint endpoint,
              FileExchange exchange,
              File file)
              throws Exception
Called when work is about to begin on this file. This method may attempt to acquire some file lock before returning true; returning false if the file lock could not be obtained so that the file should be ignored.

Parameters:
endpoint - the endpoint
exchange - the exchange
file - the file
Returns:
true if the file can be processed (such as if a file lock could be obtained)
Throws:
Exception - can be thrown in case of errors

commit

void commit(FileEndpoint endpoint,
            FileExchange exchange,
            File file)
            throws Exception
Releases any file locks and possibly deletes or moves the file after successful processing

Parameters:
endpoint - the endpoint
exchange - the exchange
file - the file
Throws:
Exception - can be thrown in case of errors

rollback

void rollback(FileEndpoint endpoint,
              FileExchange exchange,
              File file)
Releases any file locks and possibly deletes or moves the file after unsuccessful processing

Parameters:
endpoint - the endpoint
exchange - the exchange
file - the file


Copyright © 2010 IONA Open Source Community. All Rights Reserved.