Class HikariCPBackedDataSourceExtension
- All Implemented Interfaces:
Extension
Extension that arranges for named DataSource
injection points to be satisfied.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidaddBean(BeanConfigurator<DataSource> beanConfigurator, Named dataSourceName, Properties dataSourceProperties) Called internally to permit subclasses to add aT-typed bean, qualified with at least the suppliedNamed, using the suppliedBeanConfigurator.protected final StringgetDataSourceName(Matcher dataSourcePropertyPatternMatcher) Given aMatcherthat has been produced by theAbstractDataSourceExtension.getDataSourcePropertyPatternMatcher(String)method, returns the relevant data source name.protected final StringgetDataSourcePropertyName(Matcher dataSourcePropertyPatternMatcher) Given aMatcherthat has been produced by theAbstractDataSourceExtension.getDataSourcePropertyPatternMatcher(String)method, returns the relevant data source property name.protected final MatchergetDataSourcePropertyPatternMatcher(String configPropertyName) Returns aMatcherfor a property name.Methods inherited from class io.helidon.integrations.datasource.cdi.AbstractDataSourceExtension
getConfig, getDataSourceNames, getPropertyNames, initializeMasterProperties, matcher, name, propertyName, putDataSourcePropertiesMethods inherited from class io.helidon.integrations.cdi.configurable.AbstractConfigurableExtension
configPropertyNames, configPropertyValue, initializeNamedProperties, names, put
-
Constructor Details
-
HikariCPBackedDataSourceExtension
public HikariCPBackedDataSourceExtension()Creates a newHikariCPBackedDataSourceExtension.
-
-
Method Details
-
getDataSourcePropertyPatternMatcher
Description copied from class:AbstractDataSourceExtensionReturns aMatcherfor a property name.Implementations of this method must not return
null.Implementations of this method must not invoke the
AbstractDataSourceExtension.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 theAbstractDataSourceExtension.getDataSourceName(Matcher)andAbstractDataSourceExtension.getDataSourcePropertyName(Matcher)methods.- Specified by:
getDataSourcePropertyPatternMatcherin classAbstractDataSourceExtension- 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:
-
getDataSourceName
Description copied from class:AbstractDataSourceExtensionGiven aMatcherthat has been produced by theAbstractDataSourceExtension.getDataSourcePropertyPatternMatcher(String)method, returns the relevant data source name.Implementations of this method may return
null.Implementations of this method must not invoke the
AbstractDataSourceExtension.name(Matcher)method or an infinite loop may result.- Specified by:
getDataSourceNamein classAbstractDataSourceExtension- Parameters:
dataSourcePropertyPatternMatcher- aMatcherproduced by theAbstractDataSourceExtension.getDataSourcePropertyPatternMatcher(String)method; must not benull- Returns:
- a data source name, or
null - See Also:
-
getDataSourcePropertyName
Description copied from class:AbstractDataSourceExtensionGiven aMatcherthat has been produced by theAbstractDataSourceExtension.getDataSourcePropertyPatternMatcher(String)method, returns the relevant data source property name.Implementations of this method may return
null.Implementations of this method must not invoke the
AbstractDataSourceExtension.propertyName(Matcher)method or an infinite loop may result.- Specified by:
getDataSourcePropertyNamein classAbstractDataSourceExtension- Parameters:
dataSourcePropertyPatternMatcher- aMatcherproduced by theAbstractDataSourceExtension.getDataSourcePropertyPatternMatcher(String)method; must not benull- Returns:
- a data source property name, or
null - See Also:
-
addBean
protected final void addBean(BeanConfigurator<DataSource> beanConfigurator, Named dataSourceName, Properties dataSourceProperties) Description copied from class:AbstractConfigurableExtensionCalled internally to permit subclasses to add aT-typed bean, qualified with at least the suppliedNamed, using the suppliedBeanConfigurator.Implementations of this method will be called from an observer method that is observing the
AfterBeanDiscoverycontainer lifecycle event.- Specified by:
addBeanin classAbstractConfigurableExtension<DataSource>- Parameters:
beanConfigurator- theBeanConfiguratorto use to actually add a new bean; must not benulldataSourceName- aNamedinstance qualifying theT-typed bean to be added; may benulldataSourceProperties- aPropertiesinstance containing properties relevant to the object; must not benull- See Also:
-