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 |
releaseExclusiveReadLockOnAbort(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Releases the exclusive read lock granted by the acquireExclusiveReadLock method due an abort operation (acquireExclusiveReadLock returned false).
|
void |
releaseExclusiveReadLockOnCommit(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Releases the exclusive read lock granted by the acquireExclusiveReadLock method due a commit operation (Exchange processing succeeded)
|
void |
releaseExclusiveReadLockOnRollback(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Releases the exclusive read lock granted by the acquireExclusiveReadLock method due a rollback operation (Exchange processing failed)
|
void |
setMarkerFiler(boolean markerFile)
Sets whether marker file should be used or not.
|
getTimeout, prepareOnStartup, setCheckInterval, setDeleteOrphanLockFiles, setReadLockLoggingLevel, setTimeoutpublic FileRenameExclusiveReadLockStrategy()
public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategyacquireExclusiveReadLock 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 releaseExclusiveReadLockOnAbort(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategyreleaseExclusiveReadLockOnAbort in interface GenericFileExclusiveReadLockStrategy<File>releaseExclusiveReadLockOnAbort in class GenericFileRenameExclusiveReadLockStrategy<File>operations - generic file operationsfile - the fileexchange - the exchangeException - can be thrown in case of errorspublic void releaseExclusiveReadLockOnRollback(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategyreleaseExclusiveReadLockOnRollback in interface GenericFileExclusiveReadLockStrategy<File>releaseExclusiveReadLockOnRollback in class GenericFileRenameExclusiveReadLockStrategy<File>operations - generic file operationsfile - the fileexchange - the exchangeException - can be thrown in case of errorspublic void releaseExclusiveReadLockOnCommit(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategyreleaseExclusiveReadLockOnCommit in interface GenericFileExclusiveReadLockStrategy<File>releaseExclusiveReadLockOnCommit in class GenericFileRenameExclusiveReadLockStrategy<File>operations - generic file operationsfile - the fileexchange - the exchangeException - can be thrown in case of errorspublic void setMarkerFiler(boolean markerFile)
GenericFileExclusiveReadLockStrategysetMarkerFiler in interface GenericFileExclusiveReadLockStrategy<File>setMarkerFiler in class GenericFileRenameExclusiveReadLockStrategy<File>markerFile - true to use marker files.Apache Camel