Class NamedLockFactoryAdapterFactoryImpl
java.lang.Object
org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl
- All Implemented Interfaces:
NamedLockFactoryAdapterFactory
@Singleton
@Named
public class NamedLockFactoryAdapterFactoryImpl
extends Object
implements NamedLockFactoryAdapterFactory
Default implementation of
NamedLockFactoryAdapterFactory
. This implementation creates new instances of the
adapter on every call. In turn, on shutdown, it will shut down all existing named lock factories. This is merely for
simplicity, to not have to track "used" named lock factories, while it exposes all available named lock factories to
callers.
Most members and methods of this class are protected. It is meant to be extended in case of need to customize its behavior. An exception from this are private static methods, mostly meant to provide out of the box defaults and to be used when no Eclipse Sisu component container is used.
- Since:
- 1.9.1
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of the lock factory to use in session.static final String
Name of the name mapper to use in session.static final String
static final String
protected final String
protected final String
protected final Map
<String, NamedLockFactory> protected final org.slf4j.Logger
protected final Map
<String, NameMapper> -
Constructor Summary
ConstructorDescriptionNamedLockFactoryAdapterFactoryImpl
(Map<String, NamedLockFactory> factories, String defaultFactoryName, Map<String, NameMapper> nameMappers, String defaultNameMapperName, RepositorySystemLifecycle lifecycle) NamedLockFactoryAdapterFactoryImpl
(Map<String, NamedLockFactory> factories, Map<String, NameMapper> nameMappers, RepositorySystemLifecycle lifecycle) -
Method Summary
Modifier and TypeMethodDescriptionprotected NamedLockFactoryAdapter
createAdapter
(RepositorySystemSession session) Creates a new adapter instance, never returnsnull
.getAdapter
(RepositorySystemSession session) Current implementation simply delegates tocreateAdapter(RepositorySystemSession)
.protected String
Returns the default named lock factory name, nevernull
.protected String
Returns the default name mapper name, nevernull
.protected String
getFactoryName
(RepositorySystemSession session) Returns the selected (user configured or default) named lock factory name, nevernull
.protected String
getNameMapperName
(RepositorySystemSession session) Returns the selected (user configured or default) name mapper name, nevernull
.protected NamedLockFactory
selectFactory
(String factoryName) Selects a named lock factory, never returnsnull
.protected NameMapper
selectNameMapper
(String nameMapperName) Selects a name mapper, never returnsnull
.protected void
shutdown()
To be invoked on repository system shut down.
-
Field Details
-
DEFAULT_FACTORY_NAME
- See Also:
-
DEFAULT_NAME_MAPPER_NAME
- See Also:
-
CONFIG_PROP_FACTORY_KEY
Name of the lock factory to use in session.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
String
- Default value:
DEFAULT_FACTORY_NAME
-
CONFIG_PROP_NAME_MAPPER_KEY
Name of the name mapper to use in session. Out of the box supported ones are "static", "gav", "file-gav", "file-hgav", "file-static" and "discriminating".- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
String
- Default value:
DEFAULT_NAME_MAPPER_NAME
-
logger
-
factories
-
defaultFactoryName
-
nameMappers
-
defaultNameMapperName
-
-
Constructor Details
-
NamedLockFactoryAdapterFactoryImpl
@Inject public NamedLockFactoryAdapterFactoryImpl(Map<String, NamedLockFactory> factories, Map<String, NameMapper> nameMappers, RepositorySystemLifecycle lifecycle) -
NamedLockFactoryAdapterFactoryImpl
public NamedLockFactoryAdapterFactoryImpl(Map<String, NamedLockFactory> factories, String defaultFactoryName, Map<String, NameMapper> nameMappers, String defaultNameMapperName, RepositorySystemLifecycle lifecycle)
-
-
Method Details
-
getAdapter
Current implementation simply delegates tocreateAdapter(RepositorySystemSession)
.- Specified by:
getAdapter
in interfaceNamedLockFactoryAdapterFactory
-
createAdapter
Creates a new adapter instance, never returnsnull
. -
getFactoryName
Returns the selected (user configured or default) named lock factory name, nevernull
. -
getDefaultFactoryName
Returns the default named lock factory name, nevernull
. -
getNameMapperName
Returns the selected (user configured or default) name mapper name, nevernull
. -
getDefaultNameMapperName
Returns the default name mapper name, nevernull
. -
selectFactory
Selects a named lock factory, never returnsnull
. -
selectNameMapper
Selects a name mapper, never returnsnull
. -
shutdown
To be invoked on repository system shut down. This method will shut down eachNamedLockFactory
.
-