Class ArtifactLockStrategy

All Implemented Interfaces:
LockStrategy
Direct Known Subclasses:
CreateFileLockStrategy, NIOFileLockStrategy

public abstract class ArtifactLockStrategy extends FileBasedLockStrategy
  • Constructor Details

  • Method Details

    • lockArtifact

      public boolean lockArtifact(Artifact artifact, File artifactFileToDownload) throws InterruptedException
      Description copied from interface: LockStrategy
      Performs a lock before downloading the given Artifact to the given file.
      Parameters:
      artifact - the artifact about to be downloaded
      artifactFileToDownload - 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

      public void unlockArtifact(Artifact artifact, File artifactFileToDownload)
      Description copied from interface: LockStrategy
      Release the lock acquired for an artifact download.
      Parameters:
      artifact - the artifact for which the lock was acquired
      artifactFileToDownload - the file where the artifact is supposed to have been downloaded