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
ConstructorsConstructorDescriptionConnectionDetailsFactories(@Nullable ClassLoader classLoader) Create a newConnectionDetailsFactoriesinstance. -
Method Summary
Modifier and TypeMethodDescription<S> Map<Class<?>, ConnectionDetails> getConnectionDetails(S source, boolean required) Return aMapofConnectionDetailsinterface type toConnectionDetailsinstance created from the factories associated with the given source.
-
Constructor Details
-
ConnectionDetailsFactories
Create a newConnectionDetailsFactoriesinstance.- 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 aMapofConnectionDetailsinterface type toConnectionDetailsinstance 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
ConnectionDetailsinstances - 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
-