|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.component.file.strategy.FileLockExclusiveReadLockStrategy
public class FileLockExclusiveReadLockStrategy
Acquires exclusive read lock to the given file. Will wait until the lock is granted. After granting the read lock it is released, we just want to make sure that when we start consuming the file its not currently in progress of being written by third party.
| Constructor Summary | |
|---|---|
FileLockExclusiveReadLockStrategy()
|
|
| Method Summary | |
|---|---|
boolean |
acquireExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Acquires exclusive read lock to the file. |
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 |
releaseExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
Releases the exclusive read lock granted by the acquireExclusiveReadLock method. |
void |
setTimeout(long timeout)
Sets an optional timeout period. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileLockExclusiveReadLockStrategy()
| Method Detail |
|---|
public void prepareOnStartup(GenericFileOperations<File> operations,
GenericFileEndpoint<File> endpoint)
GenericFileExclusiveReadLockStrategy
prepareOnStartup in interface GenericFileExclusiveReadLockStrategy<File>operations - generic file operationsendpoint - the endpoint
public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
throws Exception
GenericFileExclusiveReadLockStrategy
acquireExclusiveReadLock in interface GenericFileExclusiveReadLockStrategy<File>operations - generic file operationsfile - the fileexchange - the exchange
Exception - can be thrown in case of errors
public void releaseExclusiveReadLock(GenericFileOperations<File> operations,
GenericFile<File> file,
Exchange exchange)
throws Exception
GenericFileExclusiveReadLockStrategy
releaseExclusiveReadLock in interface GenericFileExclusiveReadLockStrategy<File>operations - generic file operationsfile - the fileexchange - the exchange
Exception - can be thrown in case of errorspublic long getTimeout()
public void setTimeout(long timeout)
setTimeout in interface GenericFileExclusiveReadLockStrategy<File>timeout - period in millis
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||