Package org.apache.ivy.plugins.lock
Class FileBasedLockStrategy
java.lang.Object
org.apache.ivy.plugins.lock.AbstractLockStrategy
org.apache.ivy.plugins.lock.FileBasedLockStrategy
- All Implemented Interfaces:
LockStrategy
- Direct Known Subclasses:
ArtifactLockStrategy
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
"locks" a file by creating it if it doesn't exist, relying on theFile.createNewFile()
atomicity.static interface
static class
Locks a file using theFileLock
mechanism. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
FileBasedLockStrategy
(boolean debugLocking) protected
FileBasedLockStrategy
(FileBasedLockStrategy.FileLocker locker, boolean debugLocking) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
acquireLock
(File file) protected String
Return a string naming the threads which currently hold this lock.protected void
releaseLock
(File file) Methods inherited from class org.apache.ivy.plugins.lock.AbstractLockStrategy
getName, isDebugLocking, setName, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.ivy.plugins.lock.LockStrategy
lockArtifact, unlockArtifact
-
Constructor Details
-
FileBasedLockStrategy
protected FileBasedLockStrategy() -
FileBasedLockStrategy
protected FileBasedLockStrategy(boolean debugLocking) -
FileBasedLockStrategy
-
-
Method Details
-
acquireLock
- Throws:
InterruptedException
-
releaseLock
-
getCurrentLockHolderNames
Return a string naming the threads which currently hold this lock.- Parameters:
file
- File- Returns:
- String
-