Class AbstractDataSourceExtension
- All Implemented Interfaces:
Extension
- Direct Known Subclasses:
HikariCPBackedDataSourceExtension
,UCPBackedDataSourceExtension
AbstractConfigurableExtension
whose subclasses arrange for DataSource
instances to be added as CDI
beans.
Thread Safety
As with all CDI portable extensions, this class' instances are not safe for concurrent use by multiple threads.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final Config
Deprecated.This method exists for backwards compatibility only and has no replacement.protected abstract String
getDataSourceName
(Matcher dataSourcePropertyPatternMatcher) Given aMatcher
that has been produced by thegetDataSourcePropertyPatternMatcher(String)
method, returns the relevant data source name.Deprecated.This method exists for backwards compatibility only.protected abstract String
getDataSourcePropertyName
(Matcher dataSourcePropertyPatternMatcher) Given aMatcher
that has been produced by thegetDataSourcePropertyPatternMatcher(String)
method, returns the relevant data source property name.protected abstract Matcher
getDataSourcePropertyPatternMatcher
(String configPropertyName) Returns aMatcher
for a property name.Deprecated.This method exists for backwards compatibility only.protected final void
Deprecated.This method exists for backwards compatibility only.protected final Matcher
Returns aMatcher
given a configuration property name that can logically identify and provide access to at least its three component names.protected final String
Given aMatcher
that has been produced by theAbstractConfigurableExtension.matcher(String)
method, returns the relevant name.protected final String
propertyName
(Matcher propertyPatternMatcher) Given aMatcher
that has been produced by theAbstractConfigurableExtension.matcher(String)
method, returns the relevant property name, ornull
if there is no such property name.protected final Properties
putDataSourceProperties
(String dataSourceName, Properties properties) Deprecated.This method exists for backwards compatibility only.Methods inherited from class io.helidon.integrations.cdi.configurable.AbstractConfigurableExtension
addBean, configPropertyNames, configPropertyValue, initializeNamedProperties, names, put
-
Constructor Details
-
AbstractDataSourceExtension
protected AbstractDataSourceExtension()Creates a newAbstractDataSourceExtension
.
-
-
Method Details
-
getConfig
Deprecated.This method exists for backwards compatibility only and has no replacement.Returns theConfig
instance used to acquire configuration property values.This method never returns
null
.This method exists for backwards compatibility only and its usage is discouraged.
- Returns:
- a non-
null
Config
instance
-
getPropertyNames
Deprecated.This method exists for backwards compatibility only. Please use theAbstractConfigurableExtension.configPropertyNames()
method instead.Calls theAbstractConfigurableExtension.configPropertyNames()
method and returns its return value.This method never returns
null
.This method exists for backwards compatibility only and the
AbstractConfigurableExtension.configPropertyNames()
method is preferred.- Returns:
- the return value of an invocation of the
AbstractConfigurableExtension.configPropertyNames()
method - See Also:
-
matcher
Description copied from class:AbstractConfigurableExtension
Returns aMatcher
given a configuration property name that can logically identify and provide access to at least its three component names.Implementations of this method must not return
null
.Given a
String
that is a configuration property name, likecom.foo.Bar.name.propertyName
, any implementation of this method must return a non-null
Matcher
that is capable of being supplied to theAbstractConfigurableExtension.name(Matcher)
andAbstractConfigurableExtension.propertyName(Matcher)
methods.- Specified by:
matcher
in classAbstractConfigurableExtension<DataSource>
- Parameters:
configPropertyName
- a configuration property name that logically contains a type name, a name and a property name; must not benull
- Returns:
- a non-
null
Matcher
- See Also:
-
getDataSourcePropertyPatternMatcher
Returns aMatcher
for a property name.Implementations of this method must not return
null
.Implementations of this method must not invoke the
matcher(String)
method or an infinite loop may result.Given a
String
likejavax.sql.DataSource.dataSourceName.dataSourcePropertyName
, any implementation of this method should return a non-null
Matcher
that is capable of being supplied to thegetDataSourceName(Matcher)
andgetDataSourcePropertyName(Matcher)
methods.- Parameters:
configPropertyName
- the name of a configuration property that logically contains a data source name and a data source property name; must not benull
- Returns:
- a non-
null
Matcher
- See Also:
-
name
Description copied from class:AbstractConfigurableExtension
Given aMatcher
that has been produced by theAbstractConfigurableExtension.matcher(String)
method, returns the relevant name.Implementations of this method may return
null
.- Specified by:
name
in classAbstractConfigurableExtension<DataSource>
- Parameters:
propertyPatternMatcher
- aMatcher
produced by theAbstractConfigurableExtension.matcher(String)
method; must not benull
- Returns:
- a name, or
null
- See Also:
-
getDataSourceName
Given aMatcher
that has been produced by thegetDataSourcePropertyPatternMatcher(String)
method, returns the relevant data source name.Implementations of this method may return
null
.Implementations of this method must not invoke the
name(Matcher)
method or an infinite loop may result.- Parameters:
dataSourcePropertyPatternMatcher
- aMatcher
produced by thegetDataSourcePropertyPatternMatcher(String)
method; must not benull
- Returns:
- a data source name, or
null
- See Also:
-
propertyName
Description copied from class:AbstractConfigurableExtension
Given aMatcher
that has been produced by theAbstractConfigurableExtension.matcher(String)
method, returns the relevant property name, ornull
if there is no such property name.Most implementations of this method will use the
Matcher.group(int)
method to produce the required property name.Implementations of this method may return
null
.- Specified by:
propertyName
in classAbstractConfigurableExtension<DataSource>
- Parameters:
propertyPatternMatcher
- aMatcher
produced by theAbstractConfigurableExtension.matcher(String)
method; must not benull
- Returns:
- a property name, or
null
- See Also:
-
getDataSourcePropertyName
Given aMatcher
that has been produced by thegetDataSourcePropertyPatternMatcher(String)
method, returns the relevant data source property name.Implementations of this method may return
null
.Implementations of this method must not invoke the
propertyName(Matcher)
method or an infinite loop may result.- Parameters:
dataSourcePropertyPatternMatcher
- aMatcher
produced by thegetDataSourcePropertyPatternMatcher(String)
method; must not benull
- Returns:
- a data source property name, or
null
- See Also:
-
getDataSourceNames
Deprecated.This method exists for backwards compatibility only. Please use theAbstractConfigurableExtension.names()
method instead.Returns aSet
of data source names known to thisAbstractDataSourceExtension
implementation.This method never returns
null
.The
Set
returned by this method is unmodifiable.- Returns:
- a non-
null
, unmodifiableSet
of known data source names
-
putDataSourceProperties
@Deprecated protected final Properties putDataSourceProperties(String dataSourceName, Properties properties) Deprecated.This method exists for backwards compatibility only. Please use theAbstractConfigurableExtension.put(String, Properties)
method instead.Adds additional synthesized properties to an internal map of data source properties whose contents will be processed eventually by theAbstractConfigurableExtension.addBean(BeanConfigurator, Named, Properties)
method.This method may return
null
.- Parameters:
dataSourceName
- the name of the data source under which the suppliedProperties
will be indexed; may benull
properties
- theProperties
to put; must not benull
- Returns:
- the prior
Properties
indexed under the supplieddataSourceName
, ornull
- Throws:
NullPointerException
- ifproperties
isnull
-
initializeMasterProperties
Deprecated.This method exists for backwards compatibility only. Please use theAbstractConfigurableExtension.initializeNamedProperties()
method instead.Calls theAbstractConfigurableExtension.initializeNamedProperties()
method.
-