Class UCPServiceConfigurationProvider
- java.lang.Object
-
- io.helidon.service.configuration.api.ServiceConfigurationProvider
-
- io.helidon.service.configuration.ucp.UCPServiceConfigurationProvider
-
- Direct Known Subclasses:
UCPServiceConfigurationACCSProvider
,UCPServiceConfigurationLocalhostProvider
@Deprecated public abstract class UCPServiceConfigurationProvider extends ServiceConfigurationProvider
Deprecated.This class is slated for removal.An abstractServiceConfigurationProvider
implementation that providesUCPServiceConfiguration
instances.- See Also:
buildFor(Set, Properties)
,UCPServiceConfiguration
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UCPServiceConfigurationProvider()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
appliesTo(Properties properties, System system, Properties coordinates)
Deprecated.Returnstrue
if thisUCPServiceConfigurationProvider
is relevant in the configuration space described by the supplied properties,System
and coordinates.ServiceConfiguration
buildFor(Set<? extends System> systems, Properties coordinates)
Deprecated.Overrides theServiceConfigurationProvider.buildFor(Set, Properties)
method to ensure that there is an authoritativeSystem
and 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 UCPServiceConfiguration
create(Properties properties, System system, Properties coordinates)
Deprecated.Creates and returns a newUCPServiceConfiguration
.protected String
getDataSourceProperty(Properties properties, System system, Properties coordinates, String dataSourceName, String unprefixedPropertyName)
Deprecated.Returns the value of a property found in theproperties
parameter value, or, failing that, in the suppliedSystem
's properties, or, failing that, in the suppliedcoordinates
parameter value, that applies to the data source identified by the supplieddataSourceName
parameter, taking into account the prefix.String
getPrefix()
Deprecated.Returns the prefix with which relevant property names will start.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 supplieddataSourceName
into the suppliedtarget
Properties
object, optionally using the suppliedsystem
andcoordinates
objects 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-
null
prefix
with which relevant property names will start
-
create
protected UCPServiceConfiguration create(Properties properties, System system, Properties coordinates)
Deprecated.Creates and returns a newUCPServiceConfiguration
.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
- aProperties
instance that can be used as the basis of aUCPServiceConfiguration
implementation; must not benull
system
- aSystem
determined to be in effect; may, strictly speaking, benull
but ordinarily is non-null
and enabledcoordinates
- aProperties
instance representing the meta-properties in effect; may benull
- Returns:
- a new, non-
null
UCPServiceConfiguration
- Throws:
NullPointerException
- ifproperties
isnull
- See Also:
UCPServiceConfiguration(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 authoritativeSystem
and 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:
buildFor
in classServiceConfigurationProvider
- Parameters:
systems
- aSet
ofSystem
s that will help determine whether aServiceConfiguration
is in effect or not; may benull
coordinates
- aProperties
instance representing the meta-properties in effect; may benull
- Returns:
- a new
ServiceConfiguration
instance suitable for the configuration space implied by the suppliedSet
ofSystem
s 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.Returnstrue
if thisUCPServiceConfigurationProvider
is relevant in the configuration space described by the supplied properties,System
and coordinates.The default implementation of this method:
- Looks for a property named
ucp.dataSourceNames
. The value of this property is a comma-separatedString
whose 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
,system
andcoordinates
are 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.dataSourceClassName
will 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
true
is 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-
null
String
then it is passed to theDriverManager.getDriver(String)
method. If that method invocation results in a non-null
return value, thentrue
is returned. - In all other cases,
false
is returned.
- Parameters:
properties
- aProperties
instance that may be used later by thecreate(Properties, io.helidon.service.configuration.api.System, Properties)
method as the basis of aUCPServiceConfiguration
implementation; must not benull
system
- aSystem
determined to be in effect; may, strictly speaking, benull
but ordinarily is non-null
and enabledcoordinates
- aProperties
instance representing the meta-properties in effect; may benull
- Returns:
true
if thisUCPServiceConfigurationProvider
applies to the configuration space implied by the supplied parameters;false
otherwise- Throws:
NullPointerException
- ifproperties
isnull
- 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 supplieddataSourceName
into the suppliedtarget
Properties
object, optionally using the suppliedsystem
andcoordinates
objects in the process.The default implementation of this method:
- Looks for a property named
ucp.
dataSourceName
.propertiesPath
. If it is found, then it will be converted to aPath
via thePaths.get(String, String...)
method. - If the resulting
Path
identifies a readable file, then the file is read into a temporaryProperties
object via theProperties.load(Reader)
method. target
will now contain a property namedjavax.sql.DataSource.
dataSourceName
.explicitlyConfigured
with aString
value oftrue
.- Every property that the temporary
Properties
object contains as a result of reading the file will be added totarget
, prefixed withjavax.sql.DataSource.
dataSourceName
.
.
If the supplied
dataSourceName
isnull
or empty, or if the property being read out of the temporaryProperties
object already starts withjavax.sql.DataSource.
, then it is copied intotarget
without any prefix or modification.- Parameters:
target
- theProperties
into which data source properties will be installed; must not benull
system
- aSystem
determined to be in effect; may, strictly speaking, benull
but ordinarily is non-null
and enabledcoordinates
- aProperties
instance representing the meta-properties in effect; may benull
dataSourceName
- the name of the data source for which properties should be installed; may benull
- Throws:
NullPointerException
- iftarget
isnull
- 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 theproperties
parameter value, or, failing that, in the suppliedSystem
's properties, or, failing that, in the suppliedcoordinates
parameter value, that applies to the data source identified by the supplieddataSourceName
parameter, taking into account the prefix.This method may return
null
.- Parameters:
properties
- theProperties
to check first; must not benull
system
- aSystem
determined to be in effect; may, strictly speaking, benull
but ordinarily is non-null
and enabledcoordinates
- aProperties
instance representing the meta-properties in effect; may benull
dataSourceName
- the name of a data source; may benull
unprefixedPropertyName
- the "simple" property name being sought; must not benull
- Returns:
- the value of the property, or
null
if no such property exists - Throws:
NullPointerException
- ifproperties
orunprefixedPropertyName
isnull
-
-