Top Description Fields Constructors Methods
org.hibernate.engine.jdbc.connections.internal

public Class ConnectionProviderInitiator

extends Object
implements StandardServiceInitiator<ConnectionProvider>
Class Inheritance
All Implemented Interfaces
org.hibernate.boot.registry.StandardServiceInitiator, org.hibernate.service.spi.ServiceInitiator
Imports
java.beans.BeanInfo, .PropertyDescriptor, java.lang.reflect.Method, java.sql.Connection, java.util.Collection, .HashMap, .HashSet, .Map, .Properties, .Set, java.util.concurrent.ConcurrentHashMap, org.hibernate.HibernateException, .MultiTenancyStrategy, org.hibernate.boot.registry.StandardServiceInitiator, org.hibernate.boot.registry.selector.spi.StrategySelector, org.hibernate.cfg.AvailableSettings, org.hibernate.engine.jdbc.connections.spi.ConnectionProvider, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.internal.log.DeprecationLogger, org.hibernate.internal.util.StringHelper, org.hibernate.internal.util.beans.BeanInfoHelper, org.hibernate.service.spi.ServiceRegistryImplementor

Instantiates and configures an appropriate ConnectionProvider.
Authors
Gavin King, Steve Ebersole, Brett Meyer

Field Summary

Modifier and TypeField and Description
public static final String
AGROAL_STRATEGY

The strategy for agroal connection pooling

public static final String
C3P0_STRATEGY

The strategy for c3p0 connection pooling

private static final Map<String, String>
public static final String
HIKARI_STRATEGY

The strategy for hikari connection pooling

public static final String
public static final ConnectionProviderInitiator
INSTANCE

Singleton access

private static final Map<Integer, String>
private static final Map<String, Integer>
private static final Map<Integer, String>
private static final Map<String, String>
private static final CoreMessageLogger
public static final String
PROXOOL_STRATEGY

The strategy for proxool connection pooling

private static final Set<String>
public static final String
VIBUR_STRATEGY

The strategy for vibur connection pooling

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean
agroalConfigDefined(Map<K, V> configValues)

private static boolean
c3p0ConfigDefined(Map<K, V> configValues)

public static Integer
extractIsolation(Map<K, V> settings)

public static Properties

Returns:

The connection properties.
getConnectionProperties
(Map<?, ?>
The map from which to build the connection specific properties.
properties
)

Build the connection properties capable of being passed to the java.sql.DriverManager#getConnection forms taking Properties argument.

public Class<ConnectionProvider>
getServiceInitiated()

Implements org.hibernate.service.spi.ServiceInitiator.getServiceInitiated.

Obtains the service role initiated by this initiator.
private Class<? extends ConnectionProvider>
private boolean
hikariConfigDefined(Map<K, V> configValues)

public ConnectionProvider
initiateService(Map<K, V>
The configuration values in effect
configurationValues
,
ServiceRegistryImplementor
The service registry. Can be used to locate services needed to fulfill initiation.
registry
)

Implements org.hibernate.boot.registry.StandardServiceInitiator.initiateService.

Initiates the managed service.
private ConnectionProvider
private ConnectionProvider
private ConnectionProvider
private ConnectionProvider
private ConnectionProvider
private ConnectionProvider
public static Integer
private static boolean
proxoolConfigDefined(Map<K, V> configValues)

public static String

Returns:

The corresponding Connection constant name.
toIsolationConnectionConstantName
(Integer
The transaction isolation numeric value.
isolation
)

Gets the Connection constant name corresponding to the given isolation.

public static String

Returns:

a nice human-readable name
toIsolationNiceName
(Integer
The transaction isolation numeric value.
isolation
)

Get the name of a JDBC transaction isolation level

private boolean
viburConfigDefined(Map<K, V> configValues)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AGROAL_STRATEGYback to summary
public static final String AGROAL_STRATEGY

The strategy for agroal connection pooling

C3P0_STRATEGYback to summary
public static final String C3P0_STRATEGY

The strategy for c3p0 connection pooling

CONDITIONAL_PROPERTIESback to summary
private static final Map<String, String> CONDITIONAL_PROPERTIES
HIKARI_STRATEGYback to summary
public static final String HIKARI_STRATEGY

The strategy for hikari connection pooling

INJECTION_DATAback to summary
public static final String INJECTION_DATA

No idea. Is this even still used?

INSTANCEback to summary
public static final ConnectionProviderInitiator INSTANCE

Singleton access

ISOLATION_VALUE_CONSTANT_NAME_MAPback to summary
private static final Map<Integer, String> ISOLATION_VALUE_CONSTANT_NAME_MAP
ISOLATION_VALUE_MAPback to summary
private static final Map<String, Integer> ISOLATION_VALUE_MAP
ISOLATION_VALUE_NICE_NAME_MAPback to summary
private static final Map<Integer, String> ISOLATION_VALUE_NICE_NAME_MAP
LEGACY_CONNECTION_PROVIDER_MAPPINGback to summary
private static final Map<String, String> LEGACY_CONNECTION_PROVIDER_MAPPING
LOGback to summary
private static final CoreMessageLogger LOG
PROXOOL_STRATEGYback to summary
public static final String PROXOOL_STRATEGY

The strategy for proxool connection pooling

SPECIAL_PROPERTIESback to summary
private static final Set<String> SPECIAL_PROPERTIES
VIBUR_STRATEGYback to summary
public static final String VIBUR_STRATEGY

The strategy for vibur connection pooling

Constructor Detail

ConnectionProviderInitiatorback to summary
public ConnectionProviderInitiator()

Method Detail

agroalConfigDefinedback to summary
private boolean agroalConfigDefined(Map<K, V> configValues)
c3p0ConfigDefinedback to summary
private static boolean c3p0ConfigDefined(Map<K, V> configValues)
extractIsolationback to summary
public static Integer extractIsolation(Map<K, V> settings)
getConnectionPropertiesback to summary
public static Properties getConnectionProperties(Map<?, ?> properties)

Build the connection properties capable of being passed to the java.sql.DriverManager#getConnection forms taking Properties argument. We seek out all keys in the passed map which start with hibernate.connection., using them to create a new Properties instance. The keys in this new Properties have the hibernate.connection. prefix trimmed.

Parameters
properties:Map<?, ?>

The map from which to build the connection specific properties.

Returns:Properties

The connection properties.

getServiceInitiatedback to summary
public Class<ConnectionProvider> getServiceInitiated()

Implements org.hibernate.service.spi.ServiceInitiator.getServiceInitiated.

Doc from org.hibernate.service.spi.ServiceInitiator.getServiceInitiated.

Obtains the service role initiated by this initiator. Should be unique within a registry

Returns:Class<ConnectionProvider>

The service role.

Annotations
@Override
getSingleRegisteredProviderback to summary
private Class<? extends ConnectionProvider> getSingleRegisteredProvider(StrategySelector strategySelector)
hikariConfigDefinedback to summary
private boolean hikariConfigDefined(Map<K, V> configValues)
initiateServiceback to summary
public ConnectionProvider initiateService(Map<K, V> configurationValues, ServiceRegistryImplementor registry)

Implements org.hibernate.boot.registry.StandardServiceInitiator.initiateService.

Doc from org.hibernate.boot.registry.StandardServiceInitiator.initiateService.

Initiates the managed service.

Parameters
configurationValues:Map<K, V>

The configuration values in effect

registry:ServiceRegistryImplementor

The service registry. Can be used to locate services needed to fulfill initiation.

Returns:ConnectionProvider

The initiated service.

Annotations
@Override
instantiateAgroalProviderback to summary
private ConnectionProvider instantiateAgroalProvider(StrategySelector strategySelector)
instantiateC3p0Providerback to summary
private ConnectionProvider instantiateC3p0Provider(StrategySelector strategySelector)
instantiateExplicitConnectionProviderback to summary
private ConnectionProvider instantiateExplicitConnectionProvider(Class<T> providerClass)
instantiateHikariProviderback to summary
private ConnectionProvider instantiateHikariProvider(StrategySelector strategySelector)
instantiateProxoolProviderback to summary
private ConnectionProvider instantiateProxoolProvider(StrategySelector strategySelector)
instantiateViburProviderback to summary
private ConnectionProvider instantiateViburProvider(StrategySelector strategySelector)
interpretIsolationback to summary
public static Integer interpretIsolation(Object setting)
proxoolConfigDefinedback to summary
private static boolean proxoolConfigDefined(Map<K, V> configValues)
toIsolationConnectionConstantNameback to summary
public static String toIsolationConnectionConstantName(Integer isolation)

Gets the Connection constant name corresponding to the given isolation.

Parameters
isolation:Integer

The transaction isolation numeric value.

Returns:String

The corresponding Connection constant name.

Exceptions
HibernateException:
If the given isolation does not map to JDBC standard isolation
See Also
toIsolationNiceName
toIsolationNiceNameback to summary
public static String toIsolationNiceName(Integer isolation)

Get the name of a JDBC transaction isolation level

Parameters
isolation:Integer

The transaction isolation numeric value.

Returns:String

a nice human-readable name

See Also
toIsolationConnectionConstantName
viburConfigDefinedback to summary
private boolean viburConfigDefined(Map<K, V> configValues)