public class MarkerFileExclusiveReadLockStrategy extends Object implements GenericFileExclusiveReadLockStrategy<File>
| Constructor and Description |
|---|
MarkerFileExclusiveReadLockStrategy() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquireExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Acquires exclusive read lock to the file.
|
void |
prepareOnStartup(GenericFileOperations<File> operations,
GenericFileEndpoint<File> endpoint)
Allows custom logic to be run on startup preparing the strategy, such as removing old lock files etc.
|
void |
releaseExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Releases the exclusive read lock granted by the acquireExclusiveReadLock method.
|
void |
setCheckInterval(long checkInterval)
Sets the check interval period.
|
void |
setMarkerFiler(boolean markerFile)
Sets whether marker file should be used or not.
|
void |
setReadLockLoggingLevel(LoggingLevel readLockLoggingLevel)
Sets logging level used when a read lock could not be acquired.
|
void |
setTimeout(long timeout)
Sets an optional timeout period.
|
public void prepareOnStartup(GenericFileOperations<File> operations, GenericFileEndpoint<File> endpoint)
GenericFileExclusiveReadLockStrategyprepareOnStartup in interface GenericFileExclusiveReadLockStrategy<File>operations - generic file operationsendpoint - the endpointpublic boolean acquireExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategyacquireExclusiveReadLock in interface GenericFileExclusiveReadLockStrategy<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
GenericFileExclusiveReadLockStrategyreleaseExclusiveReadLock in interface GenericFileExclusiveReadLockStrategy<File>operations - generic file operationsfile - the fileexchange - the exchangeException - can be thrown in case of errorspublic void setTimeout(long timeout)
GenericFileExclusiveReadLockStrategysetTimeout in interface GenericFileExclusiveReadLockStrategy<File>timeout - period in millispublic void setCheckInterval(long checkInterval)
GenericFileExclusiveReadLockStrategysetCheckInterval in interface GenericFileExclusiveReadLockStrategy<File>checkInterval - interval in millispublic void setReadLockLoggingLevel(LoggingLevel readLockLoggingLevel)
GenericFileExclusiveReadLockStrategysetReadLockLoggingLevel in interface GenericFileExclusiveReadLockStrategy<File>readLockLoggingLevel - LoggingLevelpublic void setMarkerFiler(boolean markerFile)
GenericFileExclusiveReadLockStrategysetMarkerFiler in interface GenericFileExclusiveReadLockStrategy<File>markerFile - true to use marker files.Apache Camel