Class DefaultNamedLockFactorySelector
java.lang.Object
org.eclipse.aether.internal.impl.named.DefaultNamedLockFactorySelector
- All Implemented Interfaces:
NamedLockFactorySelector
@Singleton
@Named
public class DefaultNamedLockFactorySelector
extends Object
implements NamedLockFactorySelector
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the lock factory to use in system.static final StringThe maximum amount of time to be blocked, while obtaining a named lock.static final StringThe unit of maximum amount of time.static final Stringstatic final Stringstatic final longstatic final Stringprotected final Map<String, NamedLockFactory> protected final org.slf4j.Loggerprotected final ConcurrentMap<String, NamedLockFactory> -
Constructor Summary
ConstructorsConstructorDescriptionDefaultNamedLockFactorySelector(Map<String, NamedLockFactory> factories, RepositorySystemLifecycle lifecycle) -
Method Summary
Modifier and TypeMethodDescriptionReturns immutable set of available lock factory names, to be used for logging purposes or alike.longgetLockWaitTime(Map<String, ?> configuration) Returns the maximum amount of time to be blocked, while obtaining a named lock, based on configuration.getLockWaitTimeUnit(Map<String, ?> configuration) Returns the unit of maximum amount of time based on configuration.getNamedLockFactory(Map<String, ?> configuration) SelectsNamedLockFactorybased on configuration.
-
Field Details
-
CONFIG_PROPS_PREFIX
- See Also:
-
CONFIG_PROP_FACTORY_NAME
Name of the lock factory to use in system. Out of the box supported ones are "file-lock", "rwlock-local", "semaphore-local", "noop". By adding extensions one can extend available lock factories (for example IPC locking).- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
String- Default value:
DEFAULT_FACTORY_NAME
-
DEFAULT_FACTORY_NAME
- See Also:
-
CONFIG_PROP_LOCK_WAIT_TIME
The maximum amount of time to be blocked, while obtaining a named lock.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Long- Default value:
DEFAULT_LOCK_WAIT_TIME
-
DEFAULT_LOCK_WAIT_TIME
- See Also:
-
CONFIG_PROP_LOCK_WAIT_TIME_UNIT
The unit of maximum amount of time. Accepts TimeUnit enum names.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
String- Default value:
DEFAULT_LOCK_WAIT_TIME_UNIT
-
DEFAULT_LOCK_WAIT_TIME_UNIT
- See Also:
-
logger
-
factories
-
usedFactories
-
-
Constructor Details
-
DefaultNamedLockFactorySelector
@Inject public DefaultNamedLockFactorySelector(Map<String, NamedLockFactory> factories, RepositorySystemLifecycle lifecycle)
-
-
Method Details
-
getAvailableLockFactories
Description copied from interface:NamedLockFactorySelectorReturns immutable set of available lock factory names, to be used for logging purposes or alike. Never returnsnull.- Specified by:
getAvailableLockFactoriesin interfaceNamedLockFactorySelector
-
getNamedLockFactory
Description copied from interface:NamedLockFactorySelectorSelectsNamedLockFactorybased on configuration. Never returnsnullbut may throw in case of invalid configuration.- Specified by:
getNamedLockFactoryin interfaceNamedLockFactorySelector- Parameters:
configuration- The configuration maps, must be notnull.
-
getLockWaitTime
Description copied from interface:NamedLockFactorySelectorReturns the maximum amount of time to be blocked, while obtaining a named lock, based on configuration. May throw in case of invalid configuration.- Specified by:
getLockWaitTimein interfaceNamedLockFactorySelector- Parameters:
configuration- The configuration maps, must be notnull.
-
getLockWaitTimeUnit
Description copied from interface:NamedLockFactorySelectorReturns the unit of maximum amount of time based on configuration. Never returnsnullbut may throw in case of invalid configuration.- Specified by:
getLockWaitTimeUnitin interfaceNamedLockFactorySelector- Parameters:
configuration- The configuration maps, must be notnull.
-