Class FileLockNamedLockFactory

java.lang.Object
org.eclipse.aether.named.support.NamedLockFactorySupport
org.eclipse.aether.named.providers.FileLockNamedLockFactory
All Implemented Interfaces:
NamedLockFactory

@Singleton @Named("file-lock") public class FileLockNamedLockFactory extends NamedLockFactorySupport
Named locks factory of FileLockNamedLocks. This is a bit special implementation, as it expects locks names to be fully qualified absolute file system paths.
Since:
1.7.3
  • Field Details

    • NAME

      public static final String NAME
      See Also:
    • DELETE_LOCK_FILES

      private static final boolean DELETE_LOCK_FILES
      Tweak: on Windows, the presence of StandardOpenOption.DELETE_ON_CLOSE causes concurrency issues. This flag allows to have it removed from effective flags, at the cost that lockfile directory becomes crowded with 0 byte sized lock files that are never cleaned up. Default value is true.
      See Also:
    • ATTEMPTS

      private static final int ATTEMPTS
      Tweak: on Windows, the presence of StandardOpenOption.DELETE_ON_CLOSE causes concurrency issues. This flag allows to implement similar fix as referenced JDK bug report: retry and hope the best. Default value is 5 attempts (will retry 4 times).
      See Also:
    • SLEEP_MILLIS

      private static final long SLEEP_MILLIS
      Tweak: When ATTEMPTS used, the amount of milliseconds to sleep between subsequent retries. Default value is 50 milliseconds.
    • fileChannels

      private final ConcurrentMap<String,FileChannel> fileChannels
  • Constructor Details

    • FileLockNamedLockFactory

      public FileLockNamedLockFactory()
  • Method Details