Class HikariCPServiceConfigurationProvider
- java.lang.Object
-
- io.helidon.service.configuration.api.ServiceConfigurationProvider
-
- io.helidon.service.configuration.hikaricp.HikariCPServiceConfigurationProvider
-
- Direct Known Subclasses:
HikariCPServiceConfigurationACCSProvider,HikariCPServiceConfigurationLocalhostProvider
@Deprecated public abstract class HikariCPServiceConfigurationProvider extends ServiceConfigurationProvider
Deprecated.This class is slated for removal.An abstractServiceConfigurationProviderimplementation that providesHikariCPServiceConfigurationinstances.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHikariCPServiceConfigurationProvider()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected booleanappliesTo(Properties properties, System system, Properties coordinates)Deprecated.Returnstrueif thisHikariCPServiceConfigurationProvideris relevant in the configuration space described by the supplied properties,Systemand coordinates.ServiceConfigurationbuildFor(Set<? extends System> systems, Properties coordinates)Deprecated.Overrides theServiceConfigurationProvider.buildFor(Set, Properties)method to ensure that there is an authoritativeSystemand then, if so, calls theappliesTo(Properties, io.helidon.service.configuration.api.System, Properties)method, and, if that returnstrue, then calls thecreate(Properties, io.helidon.service.configuration.api.System, Properties)method and returns its result.protected HikariCPServiceConfigurationcreate(Properties properties, System system, Properties coordinates)Deprecated.Creates and returns a newHikariCPServiceConfiguration.protected StringgetDataSourceProperty(Properties properties, System system, Properties coordinates, String dataSourceName, String unprefixedPropertyName)Deprecated.Returns the value of a property found in thepropertiesparameter value, or, failing that, in the suppliedSystem's properties, or, failing that, in the suppliedcoordinatesparameter value, that applies to the data source identified by the supplieddataSourceNameparameter, taking into account the prefix.StringgetPrefix()Deprecated.Returns the prefix with which relevant property names will start.protected voidinstallDataSourceProperties(Properties target, System system, Properties coordinates, String dataSourceName)Deprecated.Installs any discoverable properties that might exist that pertain to the data source identified by the supplieddataSourceNameinto the suppliedtargetPropertiesobject, optionally using the suppliedsystemandcoordinatesobjects in the process.-
Methods inherited from class io.helidon.service.configuration.api.ServiceConfigurationProvider
getAuthoritativeSystem, getServiceIdentifier
-
-
-
-
Method Detail
-
getPrefix
public String getPrefix()
Deprecated.Returns the prefix with which relevant property names will start.This method never returns
null.Overrides of this method must not return
null.The default implementation of this method returns
javax.sql.DataSource.Undefined behavior will result if the return value of an override of this method is empty.
- Returns:
- the non-
nullprefixwith which relevant property names will start
-
create
protected HikariCPServiceConfiguration create(Properties properties, System system, Properties coordinates)
Deprecated.Creates and returns a newHikariCPServiceConfiguration.Normally this method is invoked as a result of an invocation of the
buildFor(Set, Properties)method. In these cases, theappliesTo(Properties, io.helidon.service.configuration.api.System, Properties)method will have already been invoked and will have returnedtrue.Overrides of this method must not call the
buildFor(Set, Properties)method, as an infinite loop may result.- Parameters:
properties- aPropertiesinstance that can be used as the basis of aHikariCPServiceConfigurationimplementation; must not benullsystem- aSystemdetermined to be in effect; may, strictly speaking, benullbut ordinarily is non-nulland enabledcoordinates- aPropertiesinstance representing the meta-properties in effect; may benull- Returns:
- a new, non-
nullHikariCPServiceConfiguration - Throws:
NullPointerException- ifpropertiesisnull- See Also:
HikariCPServiceConfiguration(Properties, io.helidon.service.configuration.api.System, Properties),buildFor(Set, Properties),appliesTo(Properties, io.helidon.service.configuration.api.System, Properties)
-
buildFor
public final ServiceConfiguration buildFor(Set<? extends System> systems, Properties coordinates)
Deprecated.Overrides theServiceConfigurationProvider.buildFor(Set, Properties)method to ensure that there is an authoritativeSystemand then, if so, calls theappliesTo(Properties, io.helidon.service.configuration.api.System, Properties)method, and, if that returnstrue, then calls thecreate(Properties, io.helidon.service.configuration.api.System, Properties)method and returns its result.This method may—and often does—return
null.- Specified by:
buildForin classServiceConfigurationProvider- Parameters:
systems- aSetofSystems that will help determine whether aServiceConfigurationis in effect or not; may benullcoordinates- aPropertiesinstance representing the meta-properties in effect; may benull- Returns:
- a new
ServiceConfigurationinstance suitable for the configuration space implied by the suppliedSetofSystems and coordinates, ornull - See Also:
appliesTo(Properties, io.helidon.service.configuration.api.System, Properties),create(Properties, io.helidon.service.configuration.api.System, Properties)
-
appliesTo
protected boolean appliesTo(Properties properties, System system, Properties coordinates)
Deprecated.Returnstrueif thisHikariCPServiceConfigurationProvideris relevant in the configuration space described by the supplied properties,Systemand coordinates.The default implementation of this method:
- Looks for a property named
hikaricp.dataSourceNames. The value of this property is a comma-separatedStringwhose components are names of data sources that will ultimately have Hikari connection pools set up for them. - If that property is not found, then all property names
found in the supplied
properties,systemandcoordinatesare scanned for those starting withjavax.sql.DataSource., and for all names in that subset, the next period-separated component of the name is taken to be a data source name. For example, a property namedjavax.sql.DataSource.test.dataSourceClassNamewill yield a data source name oftest. - For each such data source name discovered, the
installDataSourceProperties(Properties, io.helidon.service.configuration.api.System, Properties, String)method is called with the parameters supplied to this method and the data source name. - After this installation step, a property named according to
the following pattern is sought:
javax.sql.DataSource.dataSourceName.dataSourceClassName. - If that yields a class name and the corresponding class can
be loaded, then
trueis returned. - If that does not yield a class name, then a property named
according to the following pattern is sought:
javax.sql.DataSource.dataSourceName.jdbcUrl. - If that yields a non-
nullStringthen it is passed to theDriverManager.getDriver(String)method. If that method invocation results in a non-nullreturn value, thentrueis returned. - In all other cases,
falseis returned.
- Parameters:
properties- aPropertiesinstance that may be used later by thecreate(Properties, io.helidon.service.configuration.api.System, Properties)method as the basis of aHikariCPServiceConfigurationimplementation; must not benullsystem- aSystemdetermined to be in effect; may, strictly speaking, benullbut ordinarily is non-nulland enabledcoordinates- aPropertiesinstance representing the meta-properties in effect; may benull- Returns:
trueif thisHikariCPServiceConfigurationProviderapplies to the configuration space implied by the supplied parameters;falseotherwise- Throws:
NullPointerException- ifpropertiesisnull
- Looks for a property named
-
installDataSourceProperties
protected void installDataSourceProperties(Properties target, System system, Properties coordinates, String dataSourceName)
Deprecated.Installs any discoverable properties that might exist that pertain to the data source identified by the supplieddataSourceNameinto the suppliedtargetPropertiesobject, optionally using the suppliedsystemandcoordinatesobjects in the process.The default implementation of this method:
- Looks for a property named
hikaricp.dataSourceName.propertiesPath. If it is found, then it will be converted to aPathvia thePaths.get(String, String...)method. - If the resulting
Pathidentifies a readable file, then the file is read into a temporaryPropertiesobject via theProperties.load(Reader)method. targetwill now contain a property namedjavax.sql.DataSource.dataSourceName.explicitlyConfiguredwith aStringvalue oftrue.- Every property that the temporary
Propertiesobject contains as a result of reading the file will be added totarget, prefixed withjavax.sql.DataSource.dataSourceName..
If the supplied
dataSourceNameisnullor empty, or if the property being read out of the temporaryPropertiesobject already starts withjavax.sql.DataSource., then it is copied intotargetwithout any prefix or modification.- Parameters:
target- thePropertiesinto which data source properties will be installed; must not benullsystem- aSystemdetermined to be in effect; may, strictly speaking, benullbut ordinarily is non-nulland enabledcoordinates- aPropertiesinstance representing the meta-properties in effect; may benulldataSourceName- the name of the data source for which properties should be installed; may benull- Throws:
NullPointerException- iftargetisnull
- Looks for a property named
-
getDataSourceProperty
protected final String getDataSourceProperty(Properties properties, System system, Properties coordinates, String dataSourceName, String unprefixedPropertyName)
Deprecated.Returns the value of a property found in thepropertiesparameter value, or, failing that, in the suppliedSystem's properties, or, failing that, in the suppliedcoordinatesparameter value, that applies to the data source identified by the supplieddataSourceNameparameter, taking into account the prefix.This method may return
null.- Parameters:
properties- thePropertiesto check first; must not benullsystem- aSystemdetermined to be in effect; may, strictly speaking, benullbut ordinarily is non-nulland enabledcoordinates- aPropertiesinstance representing the meta-properties in effect; may benulldataSourceName- the name of a data source; may benullunprefixedPropertyName- the "simple" property name being sought; must not benull- Returns:
- the value of the property, or
nullif no such property exists - Throws:
NullPointerException- ifpropertiesorunprefixedPropertyNameisnull
-
-