|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy
org.apache.camel.component.file.strategy.FileChangedExclusiveReadLockStrategy
public class FileChangedExclusiveReadLockStrategy
Acquires exclusive read lock to the given file by checking whether the file is being changed by scanning the file at different intervals (to detect changes).
| Constructor Summary | |
|---|---|
FileChangedExclusiveReadLockStrategy()
|
|
| Method Summary | |
|---|---|
boolean |
acquireExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Acquires exclusive read lock to the file. |
long |
getCheckInterval()
|
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 |
setTimeout(long timeout)
Sets an optional timeout period. |
| Methods inherited from class org.apache.camel.component.file.strategy.MarkerFileExclusiveReadLockStrategy |
|---|
releaseExclusiveReadLock |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileChangedExclusiveReadLockStrategy()
| Method Detail |
|---|
public void prepareOnStartup(GenericFileOperations<File> operations,
GenericFileEndpoint<File> endpoint)
GenericFileExclusiveReadLockStrategy
prepareOnStartup in interface GenericFileExclusiveReadLockStrategy<File>prepareOnStartup in class MarkerFileExclusiveReadLockStrategyoperations - generic file operationsendpoint - the endpoint
public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
throws Exception
GenericFileExclusiveReadLockStrategy
acquireExclusiveReadLock in interface GenericFileExclusiveReadLockStrategy<File>acquireExclusiveReadLock in class MarkerFileExclusiveReadLockStrategyoperations - generic file operationsfile - the fileexchange - the exchange
Exception - can be thrown in case of errorspublic long getTimeout()
public void setTimeout(long timeout)
GenericFileExclusiveReadLockStrategy
setTimeout in interface GenericFileExclusiveReadLockStrategy<File>setTimeout in class MarkerFileExclusiveReadLockStrategytimeout - period in millispublic long getCheckInterval()
public void setCheckInterval(long checkInterval)
GenericFileExclusiveReadLockStrategy
setCheckInterval in interface GenericFileExclusiveReadLockStrategy<File>setCheckInterval in class MarkerFileExclusiveReadLockStrategycheckInterval - interval in millis
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||