Class NamedLockFactoryAdapterFactoryImpl
java.lang.Object
org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl
- All Implemented Interfaces:
NamedLockFactoryAdapterFactory
,Service
@Singleton
@Named
public class NamedLockFactoryAdapterFactoryImpl
extends Object
implements NamedLockFactoryAdapterFactory, Service
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 TypeFieldDescriptionprotected final String
protected final String
protected final Map
<String, NamedLockFactory> protected static final String
protected final org.slf4j.Logger
protected static final String
protected final Map
<String, NameMapper> -
Constructor Summary
ConstructorDescriptionDeprecated.for use in SL only.NamedLockFactoryAdapterFactoryImpl
(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
.void
initService
(ServiceLocator locator) Provides the opportunity to initialize this service and to acquire other services for its operation from the locator.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
-
FACTORY_KEY
- See Also:
-
NAME_MAPPER_KEY
- See Also:
-
logger
-
factories
-
defaultFactoryName
-
nameMappers
-
defaultNameMapperName
-
-
Constructor Details
-
NamedLockFactoryAdapterFactoryImpl
Deprecated.for use in SL only.Default constructor for non Eclipse Sisu uses. -
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
-
initService
Description copied from interface:Service
Provides the opportunity to initialize this service and to acquire other services for its operation from the locator. A service must not save the reference to the provided service locator.- Specified by:
initService
in interfaceService
- Parameters:
locator
- The service locator, must not benull
.
-
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
.
-