public class GenericFileRenameExclusiveReadLockStrategy<T> extends Object implements GenericFileExclusiveReadLockStrategy<T>
Constructor and Description |
---|
GenericFileRenameExclusiveReadLockStrategy() |
Modifier and Type | Method and Description |
---|---|
boolean |
acquireExclusiveReadLock(GenericFileOperations<T> operations,
GenericFile<T> file,
Exchange exchange)
Acquires exclusive read lock to the file.
|
long |
getTimeout() |
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 |
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 GenericFileRenameExclusiveReadLockStrategy()
public void prepareOnStartup(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint) throws Exception
GenericFileExclusiveReadLockStrategy
prepareOnStartup
in interface GenericFileExclusiveReadLockStrategy<T>
operations
- generic file operationsendpoint
- the endpointException
- can be thrown in case of errorspublic boolean acquireExclusiveReadLock(GenericFileOperations<T> operations, GenericFile<T> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategy
acquireExclusiveReadLock
in interface GenericFileExclusiveReadLockStrategy<T>
operations
- generic file operationsfile
- the fileexchange
- the exchangeException
- can be thrown in case of errorspublic void releaseExclusiveReadLock(GenericFileOperations<T> operations, GenericFile<T> file, Exchange exchange) throws Exception
GenericFileExclusiveReadLockStrategy
releaseExclusiveReadLock
in interface GenericFileExclusiveReadLockStrategy<T>
operations
- generic file operationsfile
- the fileexchange
- the exchangeException
- can be thrown in case of errorspublic long getTimeout()
public void setTimeout(long timeout)
GenericFileExclusiveReadLockStrategy
setTimeout
in interface GenericFileExclusiveReadLockStrategy<T>
timeout
- period in millispublic void setCheckInterval(long checkInterval)
GenericFileExclusiveReadLockStrategy
setCheckInterval
in interface GenericFileExclusiveReadLockStrategy<T>
checkInterval
- interval in millispublic void setReadLockLoggingLevel(LoggingLevel readLockLoggingLevel)
GenericFileExclusiveReadLockStrategy
setReadLockLoggingLevel
in interface GenericFileExclusiveReadLockStrategy<T>
readLockLoggingLevel
- LoggingLevelApache Camel