|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GenericFileExclusiveReadLockStrategy<T>
Strategy for acquiring exclusive read locks for files to be consumed. After granting the read lock it is released, we just want to make sure that when we start consuming the file its not currently in progress of being written by third party.
Camel supports out of the box the following strategies:
Method Summary | |
---|---|
boolean |
acquireExclusiveReadLock(GenericFileOperations<T> operations,
GenericFile<T> file,
Exchange exchange)
Acquires exclusive read lock to the file. |
void |
prepareOnStartup(GenericFileOperations<T> operations,
GenericFileEndpoint<T> endpoint)
Allows custom logic to be run on startup preparing the strategy, such as removing old lock files etc. |
void |
releaseExclusiveReadLock(GenericFileOperations<T> operations,
GenericFile<T> file,
Exchange exchange)
Releases the exclusive read lock granted by the acquireExclusiveReadLock method. |
void |
setCheckInterval(long checkInterval)
Sets the check interval period. |
void |
setTimeout(long timeout)
Sets an optional timeout period. |
Method Detail |
---|
void prepareOnStartup(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint) throws Exception
operations
- generic file operationsendpoint
- the endpoint
Exception
- can be thrown in case of errorsboolean acquireExclusiveReadLock(GenericFileOperations<T> operations, GenericFile<T> file, Exchange exchange) throws Exception
operations
- generic file operationsfile
- the fileexchange
- the exchange
Exception
- can be thrown in case of errorsvoid releaseExclusiveReadLock(GenericFileOperations<T> operations, GenericFile<T> file, Exchange exchange) throws Exception
operations
- generic file operationsfile
- the fileexchange
- the exchange
Exception
- can be thrown in case of errorsvoid setTimeout(long timeout)
timeout
- period in millisvoid setCheckInterval(long checkInterval)
checkInterval
- interval in millis
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |