Class ArtifactLockStrategy
java.lang.Object
org.apache.ivy.plugins.lock.AbstractLockStrategy
org.apache.ivy.plugins.lock.FileBasedLockStrategy
org.apache.ivy.plugins.lock.ArtifactLockStrategy
- All Implemented Interfaces:
LockStrategy
- Direct Known Subclasses:
CreateFileLockStrategy, NIOFileLockStrategy
-
Nested Class Summary
Nested classes/interfaces inherited from class FileBasedLockStrategy
FileBasedLockStrategy.CreateFileLocker, FileBasedLockStrategy.FileLocker, FileBasedLockStrategy.NIOFileLocker -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedArtifactLockStrategy(FileBasedLockStrategy.FileLocker locker, boolean debugLocking) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlockArtifact(Artifact artifact, File artifactFileToDownload) Performs a lock before downloading the givenArtifactto the given file.voidunlockArtifact(Artifact artifact, File artifactFileToDownload) Release the lock acquired for an artifact download.Methods inherited from class FileBasedLockStrategy
acquireLock, getCurrentLockHolderNames, releaseLockMethods inherited from class AbstractLockStrategy
getName, isDebugLocking, setName, toString
-
Constructor Details
-
ArtifactLockStrategy
-
-
Method Details
-
lockArtifact
public boolean lockArtifact(Artifact artifact, File artifactFileToDownload) throws InterruptedException Description copied from interface:LockStrategyPerforms a lock before downloading the givenArtifactto the given file.- Parameters:
artifact- the artifact about to be downloadedartifactFileToDownload- the file where the artifact will be downloaded- Returns:
- true if the artifact is locked, false otherwise
- Throws:
InterruptedException- if the thread is interrupted while waiting to acquire the lock
-
unlockArtifact
Description copied from interface:LockStrategyRelease the lock acquired for an artifact download.- Parameters:
artifact- the artifact for which the lock was acquiredartifactFileToDownload- the file where the artifact is supposed to have been downloaded
-