Package org.hibernate.reactive.provider
Class ReactiveServiceRegistryBuilder
- java.lang.Object
-
- org.hibernate.boot.registry.StandardServiceRegistryBuilder
-
- org.hibernate.reactive.provider.ReactiveServiceRegistryBuilder
-
public final class ReactiveServiceRegistryBuilder extends StandardServiceRegistryBuilder
Adaptation ofStandardServiceRegistryBuilder; the main difference is the use of a different initial set of services and the fact this will not attempt to load service contributors and otherIntegrators.- See Also:
ReactiveServiceInitiators
-
-
Field Summary
-
Fields inherited from class org.hibernate.boot.registry.StandardServiceRegistryBuilder
DEFAULT_CFG_RESOURCE_NAME
-
-
Constructor Summary
Constructors Constructor Description ReactiveServiceRegistryBuilder()Create a default builder.ReactiveServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry)Create a builder with the specified bootstrap services.ReactiveServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry, LoadedConfig loadedConfigBaseline)Create a builder with the specified bootstrap services.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StandardServiceRegistryBuilderaddInitiator(StandardServiceInitiator initiator)Adds a service initiator.StandardServiceRegistryBuilderaddService(Class serviceRole, Service service)Adds a user-provided service.StandardServiceRegistryBuilderapplySetting(String settingName, Object value)Apply a setting value.StandardServiceRegistryBuilderapplySettings(Map settings)Apply a groups of setting values.StandardServiceRegistrybuild()Build the StandardServiceRegistry.voidclearSettings()StandardServiceRegistryBuilderconfigure()Read setting information from an XML file using the standard resource location.StandardServiceRegistryBuilderconfigure(File configurationFile)StandardServiceRegistryBuilderconfigure(String resourceName)Read setting information from an XML file using the named resource location.StandardServiceRegistryBuilderconfigure(URL url)StandardServiceRegistryBuilderconfigure(LoadedConfig loadedConfig)static voiddestroy(ServiceRegistry serviceRegistry)Destroy a service registry.StandardServiceRegistryBuilderdisableAutoClose()By default, when a ServiceRegistry is no longer referenced by any other registries as a parent it will be closed.StandardServiceRegistryBuilderenableAutoClose()See the discussion ondisableAutoClose().static StandardServiceRegistryBuilderforJpa(BootstrapServiceRegistry bootstrapServiceRegistry)LoadedConfiggetAggregatedCfgXml()Intended for internal testing use only!!BootstrapServiceRegistrygetBootstrapServiceRegistry()org.hibernate.boot.cfgxml.internal.ConfigLoadergetConfigLoader()StandardServiceRegistryBuilderloadProperties(File file)Read settings from aPropertiesfile by File referenceStandardServiceRegistryBuilderloadProperties(String resourceName)Read settings from aPropertiesfile by resource name.-
Methods inherited from class org.hibernate.boot.registry.StandardServiceRegistryBuilder
getSettings
-
-
-
-
Constructor Detail
-
ReactiveServiceRegistryBuilder
public ReactiveServiceRegistryBuilder()
Create a default builder.
-
ReactiveServiceRegistryBuilder
public ReactiveServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry)
Create a builder with the specified bootstrap services.- Parameters:
bootstrapServiceRegistry- Provided bootstrap registry to use.
-
ReactiveServiceRegistryBuilder
public ReactiveServiceRegistryBuilder(BootstrapServiceRegistry bootstrapServiceRegistry, LoadedConfig loadedConfigBaseline)
Create a builder with the specified bootstrap services.- Parameters:
bootstrapServiceRegistry- Provided bootstrap registry to use.
-
-
Method Detail
-
forJpa
public static StandardServiceRegistryBuilder forJpa(BootstrapServiceRegistry bootstrapServiceRegistry)
-
getConfigLoader
public org.hibernate.boot.cfgxml.internal.ConfigLoader getConfigLoader()
- Overrides:
getConfigLoaderin classStandardServiceRegistryBuilder
-
getAggregatedCfgXml
public LoadedConfig getAggregatedCfgXml()
Intended for internal testing use only!!- Overrides:
getAggregatedCfgXmlin classStandardServiceRegistryBuilder
-
getBootstrapServiceRegistry
public BootstrapServiceRegistry getBootstrapServiceRegistry()
- Overrides:
getBootstrapServiceRegistryin classStandardServiceRegistryBuilder
-
loadProperties
public StandardServiceRegistryBuilder loadProperties(String resourceName)
Read settings from aPropertiesfile by resource name.Differs from
configure()andconfigure(String)in that here we expect to read aPropertiesfile while forconfigure()we read the XML variant.- Overrides:
loadPropertiesin classStandardServiceRegistryBuilder- Parameters:
resourceName- The name by which to perform a resource look up for the properties file.- Returns:
- this, for method chaining
- See Also:
configure(),configure(String)
-
loadProperties
public StandardServiceRegistryBuilder loadProperties(File file)
Read settings from aPropertiesfile by File referenceDiffers from
configure()andconfigure(String)in that here we expect to read aPropertiesfile while forconfigure()we read the XML variant.- Overrides:
loadPropertiesin classStandardServiceRegistryBuilder- Parameters:
file- The properties File reference- Returns:
- this, for method chaining
- See Also:
configure(),configure(String)
-
configure
public StandardServiceRegistryBuilder configure()
Read setting information from an XML file using the standard resource location.- Overrides:
configurein classStandardServiceRegistryBuilder- Returns:
- this, for method chaining
- See Also:
StandardServiceRegistryBuilder.DEFAULT_CFG_RESOURCE_NAME,configure(String),loadProperties(String)
-
configure
public StandardServiceRegistryBuilder configure(String resourceName)
Read setting information from an XML file using the named resource location.- Overrides:
configurein classStandardServiceRegistryBuilder- Parameters:
resourceName- The named resource- Returns:
- this, for method chaining
-
configure
public StandardServiceRegistryBuilder configure(File configurationFile)
- Overrides:
configurein classStandardServiceRegistryBuilder
-
configure
public StandardServiceRegistryBuilder configure(URL url)
- Overrides:
configurein classStandardServiceRegistryBuilder
-
configure
public StandardServiceRegistryBuilder configure(LoadedConfig loadedConfig)
- Overrides:
configurein classStandardServiceRegistryBuilder
-
applySetting
public StandardServiceRegistryBuilder applySetting(String settingName, Object value)
Apply a setting value.- Overrides:
applySettingin classStandardServiceRegistryBuilder- Parameters:
settingName- The name of the settingvalue- The value to use.- Returns:
- this, for method chaining
-
applySettings
public StandardServiceRegistryBuilder applySettings(Map settings)
Apply a groups of setting values.- Overrides:
applySettingsin classStandardServiceRegistryBuilder- Parameters:
settings- The incoming settings to apply- Returns:
- this, for method chaining
-
clearSettings
public void clearSettings()
- Overrides:
clearSettingsin classStandardServiceRegistryBuilder
-
addInitiator
public StandardServiceRegistryBuilder addInitiator(StandardServiceInitiator initiator)
Adds a service initiator.- Overrides:
addInitiatorin classStandardServiceRegistryBuilder- Parameters:
initiator- The initiator to be added- Returns:
- this, for method chaining
-
addService
public StandardServiceRegistryBuilder addService(Class serviceRole, Service service)
Adds a user-provided service.- Overrides:
addServicein classStandardServiceRegistryBuilder- Parameters:
serviceRole- The role of the service being addedservice- The service implementation- Returns:
- this, for method chaining
-
disableAutoClose
public StandardServiceRegistryBuilder disableAutoClose()
By default, when a ServiceRegistry is no longer referenced by any other registries as a parent it will be closed. Some applications that explicitly build "shared registries" may want to circumvent that behavior. This method indicates that the registry being built should not be automatically closed. The caller agrees to take responsibility to close it themselves.- Overrides:
disableAutoClosein classStandardServiceRegistryBuilder- Returns:
- this, for method chaining
-
enableAutoClose
public StandardServiceRegistryBuilder enableAutoClose()
See the discussion ondisableAutoClose(). This method enables the auto-closing.- Overrides:
enableAutoClosein classStandardServiceRegistryBuilder- Returns:
- this, for method chaining
-
build
public StandardServiceRegistry build()
Build the StandardServiceRegistry.- Overrides:
buildin classStandardServiceRegistryBuilder- Returns:
- The StandardServiceRegistry.
-
destroy
public static void destroy(ServiceRegistry serviceRegistry)
Destroy a service registry. Applications should only destroy registries they have explicitly created.- Parameters:
serviceRegistry- The registry to be closed.
-
-