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 interfacestatic classLocks a file using theFileLockmechanism. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedFileBasedLockStrategy(boolean debugLocking) protectedFileBasedLockStrategy(FileBasedLockStrategy.FileLocker locker, boolean debugLocking) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanacquireLock(File file) protected StringReturn a string naming the threads which currently hold this lock.protected voidreleaseLock(File file) Methods inherited from class org.apache.ivy.plugins.lock.AbstractLockStrategy
getName, isDebugLocking, setName, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
-