public class FileRenameExclusiveReadLockStrategy extends GenericFileRenameExclusiveReadLockStrategy<File>
MarkerFileExclusiveReadLockStrategy
as well, to ensure only acquiring locks on files, which is not already in progress by another process,
that have marked this using the marker file.
Setting the option setMarkerFiler(boolean)
to false allows to turn off using marker files.Constructor and Description |
---|
FileRenameExclusiveReadLockStrategy() |
Modifier and Type | Method and Description |
---|---|
boolean |
acquireExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Acquires exclusive read lock to the file.
|
void |
releaseExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Releases the exclusive read lock granted by the acquireExclusiveReadLock method.
|
void |
setMarkerFiler(boolean markerFile)
Sets whether marker file should be used or not.
|
getTimeout, prepareOnStartup, setCheckInterval, setReadLockLoggingLevel, setTimeout
public FileRenameExclusiveReadLockStrategy()
public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategy
acquireExclusiveReadLock
in interface GenericFileExclusiveReadLockStrategy<File>
acquireExclusiveReadLock
in class GenericFileRenameExclusiveReadLockStrategy<File>
operations
- generic file operationsfile
- the fileexchange
- the exchangeException
- can be thrown in case of errorspublic void releaseExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategy
releaseExclusiveReadLock
in interface GenericFileExclusiveReadLockStrategy<File>
releaseExclusiveReadLock
in class GenericFileRenameExclusiveReadLockStrategy<File>
operations
- generic file operationsfile
- the fileexchange
- the exchangeException
- can be thrown in case of errorspublic void setMarkerFiler(boolean markerFile)
GenericFileExclusiveReadLockStrategy
setMarkerFiler
in interface GenericFileExclusiveReadLockStrategy<File>
setMarkerFiler
in class GenericFileRenameExclusiveReadLockStrategy<File>
markerFile
- true to use marker files.Apache Camel