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
FileLockNamedLock
s. This is a bit special implementation, as it
expects locks names to be fully qualified absolute file system paths.- Since:
- 1.7.3
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
Tweak: on Windows, the presence ofStandardOpenOption.DELETE_ON_CLOSE
causes concurrency issues.static final String
Tweak: on Windows, the presence ofStandardOpenOption.DELETE_ON_CLOSE
causes concurrency issues.static final String
Tweak: WhenSYSTEM_PROP_ATTEMPTS
used, the amount of milliseconds to sleep between subsequent retries.Fields inherited from class org.eclipse.aether.named.support.NamedLockFactorySupport
logger, SYSTEM_PROP_DIAGNOSTIC_ENABLED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected NamedLockSupport
createLock
(String name) Implementations shall create and returnNamedLockSupport
for givenname
, this method must never returnnull
.protected void
destroyLock
(String name) Implementation may override this (empty) method to perform some sort of implementation specific cleanup for given lock name.Methods inherited from class org.eclipse.aether.named.support.NamedLockFactorySupport
closeLock, getLock, isDiagnosticEnabled, onFailure, shutdown
-
Field Details
-
NAME
- See Also:
-
SYSTEM_PROP_DELETE_LOCK_FILES
Tweak: on Windows, the presence ofStandardOpenOption.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 istrue
.- See Also:
- Sourced from:
System.getProperty(String, String)
- Value type:
Boolean
- Default value:
- true
-
SYSTEM_PROP_ATTEMPTS
Tweak: on Windows, the presence ofStandardOpenOption.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:
- Sourced from:
System.getProperty(String, String)
- Value type:
Integer
- Default value:
- 5
-
SYSTEM_PROP_SLEEP_MILLIS
Tweak: WhenSYSTEM_PROP_ATTEMPTS
used, the amount of milliseconds to sleep between subsequent retries. Default value is 50 milliseconds.- See Also:
- Sourced from:
System.getProperty(String, String)
- Value type:
Long
- Default value:
- 50
-
-
Constructor Details
-
FileLockNamedLockFactory
public FileLockNamedLockFactory()
-
-
Method Details
-
createLock
Description copied from class:NamedLockFactorySupport
Implementations shall create and returnNamedLockSupport
for givenname
, this method must never returnnull
.- Specified by:
createLock
in classNamedLockFactorySupport
-
destroyLock
Description copied from class:NamedLockFactorySupport
Implementation may override this (empty) method to perform some sort of implementation specific cleanup for given lock name. Invoked when reference count for given name drops to zero and named lock was removed.- Overrides:
destroyLock
in classNamedLockFactorySupport
-