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 org.hibernate.boot.registry.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
-
-
Constructor Summary
Constructors Constructor Description ReactiveServiceRegistryBuilder()
Create a default builder.ReactiveServiceRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry)
Create a builder with the specified bootstrap services.ReactiveServiceRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry, org.hibernate.boot.cfgxml.spi.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 org.hibernate.boot.registry.StandardServiceRegistryBuilder
addInitiator(org.hibernate.boot.registry.StandardServiceInitiator initiator)
Adds a service initiator.org.hibernate.boot.registry.StandardServiceRegistryBuilder
addService(java.lang.Class serviceRole, org.hibernate.service.Service service)
Adds a user-provided service.org.hibernate.boot.registry.StandardServiceRegistryBuilder
applySetting(java.lang.String settingName, java.lang.Object value)
Apply a setting value.org.hibernate.boot.registry.StandardServiceRegistryBuilder
applySettings(java.util.Map settings)
Apply a groups of setting values.org.hibernate.boot.registry.StandardServiceRegistry
build()
Build the StandardServiceRegistry.void
clearSettings()
org.hibernate.boot.registry.StandardServiceRegistryBuilder
configure()
Read setting information from an XML file using the standard resource location.org.hibernate.boot.registry.StandardServiceRegistryBuilder
configure(java.io.File configurationFile)
org.hibernate.boot.registry.StandardServiceRegistryBuilder
configure(java.lang.String resourceName)
Read setting information from an XML file using the named resource location.org.hibernate.boot.registry.StandardServiceRegistryBuilder
configure(java.net.URL url)
org.hibernate.boot.registry.StandardServiceRegistryBuilder
configure(org.hibernate.boot.cfgxml.spi.LoadedConfig loadedConfig)
static void
destroy(org.hibernate.service.ServiceRegistry serviceRegistry)
Destroy a service registry.org.hibernate.boot.registry.StandardServiceRegistryBuilder
disableAutoClose()
By default, when a ServiceRegistry is no longer referenced by any other registries as a parent it will be closed.org.hibernate.boot.registry.StandardServiceRegistryBuilder
enableAutoClose()
See the discussion ondisableAutoClose()
.static org.hibernate.boot.registry.StandardServiceRegistryBuilder
forJpa(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry)
org.hibernate.boot.cfgxml.spi.LoadedConfig
getAggregatedCfgXml()
Intended for internal testing use only!!org.hibernate.boot.registry.BootstrapServiceRegistry
getBootstrapServiceRegistry()
org.hibernate.boot.cfgxml.internal.ConfigLoader
getConfigLoader()
org.hibernate.boot.registry.StandardServiceRegistryBuilder
loadProperties(java.io.File file)
Read settings from aProperties
file by File referenceorg.hibernate.boot.registry.StandardServiceRegistryBuilder
loadProperties(java.lang.String resourceName)
Read settings from aProperties
file by resource name.
-
-
-
Constructor Detail
-
ReactiveServiceRegistryBuilder
public ReactiveServiceRegistryBuilder()
Create a default builder.
-
ReactiveServiceRegistryBuilder
public ReactiveServiceRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry)
Create a builder with the specified bootstrap services.- Parameters:
bootstrapServiceRegistry
- Provided bootstrap registry to use.
-
ReactiveServiceRegistryBuilder
public ReactiveServiceRegistryBuilder(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry, org.hibernate.boot.cfgxml.spi.LoadedConfig loadedConfigBaseline)
Create a builder with the specified bootstrap services.- Parameters:
bootstrapServiceRegistry
- Provided bootstrap registry to use.
-
-
Method Detail
-
forJpa
public static org.hibernate.boot.registry.StandardServiceRegistryBuilder forJpa(org.hibernate.boot.registry.BootstrapServiceRegistry bootstrapServiceRegistry)
-
getConfigLoader
public org.hibernate.boot.cfgxml.internal.ConfigLoader getConfigLoader()
- Overrides:
getConfigLoader
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
-
getAggregatedCfgXml
public org.hibernate.boot.cfgxml.spi.LoadedConfig getAggregatedCfgXml()
Intended for internal testing use only!!- Overrides:
getAggregatedCfgXml
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
-
getBootstrapServiceRegistry
public org.hibernate.boot.registry.BootstrapServiceRegistry getBootstrapServiceRegistry()
- Overrides:
getBootstrapServiceRegistry
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
-
loadProperties
public org.hibernate.boot.registry.StandardServiceRegistryBuilder loadProperties(java.lang.String resourceName)
Read settings from aProperties
file by resource name.Differs from
configure()
andconfigure(String)
in that here we expect to read aProperties
file while forconfigure()
we read the XML variant.- Overrides:
loadProperties
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- 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 org.hibernate.boot.registry.StandardServiceRegistryBuilder loadProperties(java.io.File file)
Read settings from aProperties
file by File referenceDiffers from
configure()
andconfigure(String)
in that here we expect to read aProperties
file while forconfigure()
we read the XML variant.- Overrides:
loadProperties
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Parameters:
file
- The properties File reference- Returns:
- this, for method chaining
- See Also:
configure()
,configure(String)
-
configure
public org.hibernate.boot.registry.StandardServiceRegistryBuilder configure()
Read setting information from an XML file using the standard resource location.- Overrides:
configure
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Returns:
- this, for method chaining
- See Also:
StandardServiceRegistryBuilder.DEFAULT_CFG_RESOURCE_NAME
,configure(String)
,loadProperties(String)
-
configure
public org.hibernate.boot.registry.StandardServiceRegistryBuilder configure(java.lang.String resourceName)
Read setting information from an XML file using the named resource location.- Overrides:
configure
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Parameters:
resourceName
- The named resource- Returns:
- this, for method chaining
-
configure
public org.hibernate.boot.registry.StandardServiceRegistryBuilder configure(java.io.File configurationFile)
- Overrides:
configure
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
-
configure
public org.hibernate.boot.registry.StandardServiceRegistryBuilder configure(java.net.URL url)
- Overrides:
configure
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
-
configure
public org.hibernate.boot.registry.StandardServiceRegistryBuilder configure(org.hibernate.boot.cfgxml.spi.LoadedConfig loadedConfig)
- Overrides:
configure
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
-
applySetting
public org.hibernate.boot.registry.StandardServiceRegistryBuilder applySetting(java.lang.String settingName, java.lang.Object value)
Apply a setting value.- Overrides:
applySetting
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Parameters:
settingName
- The name of the settingvalue
- The value to use.- Returns:
- this, for method chaining
-
applySettings
public org.hibernate.boot.registry.StandardServiceRegistryBuilder applySettings(java.util.Map settings)
Apply a groups of setting values.- Overrides:
applySettings
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Parameters:
settings
- The incoming settings to apply- Returns:
- this, for method chaining
-
clearSettings
public void clearSettings()
- Overrides:
clearSettings
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
-
addInitiator
public org.hibernate.boot.registry.StandardServiceRegistryBuilder addInitiator(org.hibernate.boot.registry.StandardServiceInitiator initiator)
Adds a service initiator.- Overrides:
addInitiator
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Parameters:
initiator
- The initiator to be added- Returns:
- this, for method chaining
-
addService
public org.hibernate.boot.registry.StandardServiceRegistryBuilder addService(java.lang.Class serviceRole, org.hibernate.service.Service service)
Adds a user-provided service.- Overrides:
addService
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Parameters:
serviceRole
- The role of the service being addedservice
- The service implementation- Returns:
- this, for method chaining
-
disableAutoClose
public org.hibernate.boot.registry.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:
disableAutoClose
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Returns:
- this, for method chaining
-
enableAutoClose
public org.hibernate.boot.registry.StandardServiceRegistryBuilder enableAutoClose()
See the discussion ondisableAutoClose()
. This method enables the auto-closing.- Overrides:
enableAutoClose
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Returns:
- this, for method chaining
-
build
public org.hibernate.boot.registry.StandardServiceRegistry build()
Build the StandardServiceRegistry.- Overrides:
build
in classorg.hibernate.boot.registry.StandardServiceRegistryBuilder
- Returns:
- The StandardServiceRegistry.
-
destroy
public static void destroy(org.hibernate.service.ServiceRegistry serviceRegistry)
Destroy a service registry. Applications should only destroy registries they have explicitly created.- Parameters:
serviceRegistry
- The registry to be closed.
-
-