Class ConnectionDetailsFactories
java.lang.Object
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactories
A registry of
ConnectionDetailsFactory
instances.- Since:
- 3.1.0
- Author:
- Moritz Halbritter, Andy Wilkinson, Phillip Webb, Pedro Xavier Leite Cavadas
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.ConnectionDetailsFactories
(ClassLoader classLoader) Create a newConnectionDetailsFactories
instance. -
Method Summary
Modifier and TypeMethodDescription<S> Map<Class<?>,
ConnectionDetails> getConnectionDetails
(S source, boolean required) Return aMap
ofConnectionDetails
interface type toConnectionDetails
instance created from the factories associated with the given source.
-
Constructor Details
-
ConnectionDetailsFactories
Deprecated, for removal: This API element is subject to removal in a future version.since 3.5.0 for removal in 4.0.0 in favor ofConnectionDetailsFactories(ClassLoader)
Create a newConnectionDetailsFactories
instance. -
ConnectionDetailsFactories
Create a newConnectionDetailsFactories
instance.- Parameters:
classLoader
- the class loader used to load factories- Since:
- 3.5.0
-
-
Method Details
-
getConnectionDetails
public <S> Map<Class<?>,ConnectionDetails> getConnectionDetails(S source, boolean required) throws ConnectionDetailsFactoryNotFoundException, ConnectionDetailsNotFoundException Return aMap
ofConnectionDetails
interface type toConnectionDetails
instance created from the factories associated with the given source.- Type Parameters:
S
- the source type- Parameters:
source
- the sourcerequired
- if a connection details result is required- Returns:
- a map of
ConnectionDetails
instances - Throws:
ConnectionDetailsFactoryNotFoundException
- if a result is required but no connection details factory is registered for the sourceConnectionDetailsNotFoundException
- if a result is required but no connection details instance was created from a registered factory
-
ConnectionDetailsFactories(ClassLoader)