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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final ConfigDeprecated.This method exists for backwards compatibility only and has no replacement.protected abstract StringgetDataSourceName(Matcher dataSourcePropertyPatternMatcher) Given aMatcherthat has been produced by thegetDataSourcePropertyPatternMatcher(String)method, returns the relevant data source name.Deprecated.This method exists for backwards compatibility only.protected abstract StringgetDataSourcePropertyName(Matcher dataSourcePropertyPatternMatcher) Given aMatcherthat has been produced by thegetDataSourcePropertyPatternMatcher(String)method, returns the relevant data source property name.protected abstract MatchergetDataSourcePropertyPatternMatcher(String configPropertyName) Returns aMatcherfor a property name.Deprecated.This method exists for backwards compatibility only.protected final voidDeprecated.This method exists for backwards compatibility only.protected final MatcherReturns aMatchergiven a configuration property name that can logically identify and provide access to at least its three component names.protected final StringGiven aMatcherthat has been produced by theAbstractConfigurableExtension.matcher(String)method, returns the relevant name.protected final StringpropertyName(Matcher propertyPatternMatcher) Given aMatcherthat has been produced by theAbstractConfigurableExtension.matcher(String)method, returns the relevant property name, ornullif there is no such property name.protected final PropertiesputDataSourceProperties(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 theConfiginstance 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-
nullConfiginstance
-
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:AbstractConfigurableExtensionReturns aMatchergiven 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
Stringthat is a configuration property name, likecom.foo.Bar.name.propertyName, any implementation of this method must return a non-nullMatcherthat is capable of being supplied to theAbstractConfigurableExtension.name(Matcher)andAbstractConfigurableExtension.propertyName(Matcher)methods.- Specified by:
matcherin 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-
nullMatcher - See Also:
-
getDataSourcePropertyPatternMatcher
Returns aMatcherfor 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
Stringlikejavax.sql.DataSource.dataSourceName.dataSourcePropertyName, any implementation of this method should return a non-nullMatcherthat 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-
nullMatcher - See Also:
-
name
Description copied from class:AbstractConfigurableExtensionGiven aMatcherthat has been produced by theAbstractConfigurableExtension.matcher(String)method, returns the relevant name.Implementations of this method may return
null.- Specified by:
namein classAbstractConfigurableExtension<DataSource>- Parameters:
propertyPatternMatcher- aMatcherproduced by theAbstractConfigurableExtension.matcher(String)method; must not benull- Returns:
- a name, or
null - See Also:
-
getDataSourceName
Given aMatcherthat 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- aMatcherproduced by thegetDataSourcePropertyPatternMatcher(String)method; must not benull- Returns:
- a data source name, or
null - See Also:
-
propertyName
Description copied from class:AbstractConfigurableExtensionGiven aMatcherthat has been produced by theAbstractConfigurableExtension.matcher(String)method, returns the relevant property name, ornullif 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:
propertyNamein classAbstractConfigurableExtension<DataSource>- Parameters:
propertyPatternMatcher- aMatcherproduced by theAbstractConfigurableExtension.matcher(String)method; must not benull- Returns:
- a property name, or
null - See Also:
-
getDataSourcePropertyName
Given aMatcherthat 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- aMatcherproduced 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 aSetof data source names known to thisAbstractDataSourceExtensionimplementation.This method never returns
null.The
Setreturned by this method is unmodifiable.- Returns:
- a non-
null, unmodifiableSetof 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 suppliedPropertieswill be indexed; may benullproperties- thePropertiesto put; must not benull- Returns:
- the prior
Propertiesindexed under the supplieddataSourceName, ornull - Throws:
NullPointerException- ifpropertiesisnull
-
initializeMasterProperties
Deprecated.This method exists for backwards compatibility only. Please use theAbstractConfigurableExtension.initializeNamedProperties()method instead.Calls theAbstractConfigurableExtension.initializeNamedProperties()method.
-