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 StandardServiceRegistryBuilder
addInitiator(StandardServiceInitiator initiator)
Adds a service initiator.StandardServiceRegistryBuilder
addService(Class serviceRole, Service service)
Adds a user-provided service.StandardServiceRegistryBuilder
applySetting(String settingName, Object value)
Apply a setting value.StandardServiceRegistryBuilder
applySettings(Map settings)
Apply a groups of setting values.StandardServiceRegistry
build()
Build the StandardServiceRegistry.void
clearSettings()
StandardServiceRegistryBuilder
configure()
Read setting information from an XML file using the standard resource location.StandardServiceRegistryBuilder
configure(File configurationFile)
StandardServiceRegistryBuilder
configure(String resourceName)
Read setting information from an XML file using the named resource location.StandardServiceRegistryBuilder
configure(URL url)
StandardServiceRegistryBuilder
configure(LoadedConfig loadedConfig)
static void
destroy(ServiceRegistry serviceRegistry)
Destroy a service registry.StandardServiceRegistryBuilder
disableAutoClose()
By default, when a ServiceRegistry is no longer referenced by any other registries as a parent it will be closed.StandardServiceRegistryBuilder
enableAutoClose()
See the discussion ondisableAutoClose()
.static StandardServiceRegistryBuilder
forJpa(BootstrapServiceRegistry bootstrapServiceRegistry)
LoadedConfig
getAggregatedCfgXml()
Intended for internal testing use only!!BootstrapServiceRegistry
getBootstrapServiceRegistry()
org.hibernate.boot.cfgxml.internal.ConfigLoader
getConfigLoader()
StandardServiceRegistryBuilder
loadProperties(File file)
Read settings from aProperties
file by File referenceStandardServiceRegistryBuilder
loadProperties(String resourceName)
Read settings from aProperties
file 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:
getConfigLoader
in classStandardServiceRegistryBuilder
-
getAggregatedCfgXml
public LoadedConfig getAggregatedCfgXml()
Intended for internal testing use only!!- Overrides:
getAggregatedCfgXml
in classStandardServiceRegistryBuilder
-
getBootstrapServiceRegistry
public BootstrapServiceRegistry getBootstrapServiceRegistry()
- Overrides:
getBootstrapServiceRegistry
in classStandardServiceRegistryBuilder
-
loadProperties
public StandardServiceRegistryBuilder loadProperties(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 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 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 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:
configure
in 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:
configure
in classStandardServiceRegistryBuilder
- Parameters:
resourceName
- The named resource- Returns:
- this, for method chaining
-
configure
public StandardServiceRegistryBuilder configure(File configurationFile)
- Overrides:
configure
in classStandardServiceRegistryBuilder
-
configure
public StandardServiceRegistryBuilder configure(URL url)
- Overrides:
configure
in classStandardServiceRegistryBuilder
-
configure
public StandardServiceRegistryBuilder configure(LoadedConfig loadedConfig)
- Overrides:
configure
in classStandardServiceRegistryBuilder
-
applySetting
public StandardServiceRegistryBuilder applySetting(String settingName, Object value)
Apply a setting value.- Overrides:
applySetting
in 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:
applySettings
in classStandardServiceRegistryBuilder
- Parameters:
settings
- The incoming settings to apply- Returns:
- this, for method chaining
-
clearSettings
public void clearSettings()
- Overrides:
clearSettings
in classStandardServiceRegistryBuilder
-
addInitiator
public StandardServiceRegistryBuilder addInitiator(StandardServiceInitiator initiator)
Adds a service initiator.- Overrides:
addInitiator
in 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:
addService
in 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:
disableAutoClose
in classStandardServiceRegistryBuilder
- Returns:
- this, for method chaining
-
enableAutoClose
public StandardServiceRegistryBuilder enableAutoClose()
See the discussion ondisableAutoClose()
. This method enables the auto-closing.- Overrides:
enableAutoClose
in classStandardServiceRegistryBuilder
- Returns:
- this, for method chaining
-
build
public StandardServiceRegistry build()
Build the StandardServiceRegistry.- Overrides:
build
in 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.
-
-