public interface PathLock
The extent of such lock depends on the actual implementation. For some implementations it will be possible to create a lock at a file system level. For other implementations this might not be possible (mainly depending on the targeted file system) and thus will use different locking mechanisms.
All implementations of this interface must be (naturally) thread-safe and reentrant, meaning that a lock can be re obtained on
this instance it's been released
| Modifier and Type | Method and Description |
|---|---|
boolean |
isLocked() |
void |
release()
Releases the lock that was previously obtained by invoking
tryLock() on this instance with a true
return value. |
boolean |
tryLock()
Attempts to obtain a lock on the referenced path.
|
boolean tryLock()
Just like with any locking API, any component invoking this method on this and obtaining true as a return
value MUST make sure that the release() method is eventually invoked on this same instance.
true if the lock could be obtained. false otherwise.boolean isLocked()
this instancevoid release()
tryLock() on this instance with a true
return value.
This method will not fail if no such lock was ever obtained or has already been released.
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.