public class FileLockExclusiveReadLockStrategy extends MarkerFileExclusiveReadLockStrategy
| Constructor and Description |
|---|
FileLockExclusiveReadLockStrategy() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquireExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Acquires exclusive read lock to the file.
|
protected void |
doReleaseExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange) |
long |
getTimeout() |
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 |
setCheckInterval(long checkInterval)
Sets the check interval period.
|
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.
|
releaseExclusiveReadLockOnAbort, releaseExclusiveReadLockOnCommit, releaseExclusiveReadLockOnRollback, setDeleteOrphanLockFiles, setMarkerFilerpublic FileLockExclusiveReadLockStrategy()
public void prepareOnStartup(GenericFileOperations<File> operations, GenericFileEndpoint<File> endpoint)
GenericFileExclusiveReadLockStrategyprepareOnStartup in interface GenericFileExclusiveReadLockStrategy<File>prepareOnStartup in class MarkerFileExclusiveReadLockStrategyoperations - generic file operationsendpoint - the endpointpublic boolean acquireExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategyacquireExclusiveReadLock in interface GenericFileExclusiveReadLockStrategy<File>acquireExclusiveReadLock in class MarkerFileExclusiveReadLockStrategyoperations - generic file operationsfile - the fileexchange - the exchangeException - can be thrown in case of errorsprotected void doReleaseExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception
doReleaseExclusiveReadLock in class MarkerFileExclusiveReadLockStrategyExceptionpublic long getTimeout()
public void setTimeout(long timeout)
GenericFileExclusiveReadLockStrategysetTimeout in interface GenericFileExclusiveReadLockStrategy<File>setTimeout in class MarkerFileExclusiveReadLockStrategytimeout - period in millispublic void setCheckInterval(long checkInterval)
GenericFileExclusiveReadLockStrategysetCheckInterval in interface GenericFileExclusiveReadLockStrategy<File>setCheckInterval in class MarkerFileExclusiveReadLockStrategycheckInterval - interval in millispublic void setReadLockLoggingLevel(LoggingLevel readLockLoggingLevel)
GenericFileExclusiveReadLockStrategysetReadLockLoggingLevel in interface GenericFileExclusiveReadLockStrategy<File>setReadLockLoggingLevel in class MarkerFileExclusiveReadLockStrategyreadLockLoggingLevel - LoggingLevelApache Camel