Class ReactiveServiceRegistryBuilder


  • public final class ReactiveServiceRegistryBuilder
    extends org.hibernate.boot.registry.StandardServiceRegistryBuilder
    Adaptation of StandardServiceRegistryBuilder; 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 other Integrators.
    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​(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 on disableAutoClose().
      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 a Properties file by File reference
      org.hibernate.boot.registry.StandardServiceRegistryBuilder loadProperties​(java.lang.String resourceName)
      Read settings from a Properties file by resource name.
      • Methods inherited from class org.hibernate.boot.registry.StandardServiceRegistryBuilder

        getSettings
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 class org.hibernate.boot.registry.StandardServiceRegistryBuilder
      • getAggregatedCfgXml

        public org.hibernate.boot.cfgxml.spi.LoadedConfig getAggregatedCfgXml()
        Intended for internal testing use only!!
        Overrides:
        getAggregatedCfgXml in class org.hibernate.boot.registry.StandardServiceRegistryBuilder
      • getBootstrapServiceRegistry

        public org.hibernate.boot.registry.BootstrapServiceRegistry getBootstrapServiceRegistry()
        Overrides:
        getBootstrapServiceRegistry in class org.hibernate.boot.registry.StandardServiceRegistryBuilder
      • loadProperties

        public org.hibernate.boot.registry.StandardServiceRegistryBuilder loadProperties​(java.lang.String resourceName)
        Read settings from a Properties file by resource name.

        Differs from configure() and configure(String) in that here we expect to read a Properties file while for configure() we read the XML variant.

        Overrides:
        loadProperties in class org.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 a Properties file by File reference

        Differs from configure() and configure(String) in that here we expect to read a Properties file while for configure() we read the XML variant.

        Overrides:
        loadProperties in class org.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 class org.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 class org.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 class org.hibernate.boot.registry.StandardServiceRegistryBuilder
      • configure

        public org.hibernate.boot.registry.StandardServiceRegistryBuilder configure​(java.net.URL url)
        Overrides:
        configure in class org.hibernate.boot.registry.StandardServiceRegistryBuilder
      • configure

        public org.hibernate.boot.registry.StandardServiceRegistryBuilder configure​(org.hibernate.boot.cfgxml.spi.LoadedConfig loadedConfig)
        Overrides:
        configure in class org.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 class org.hibernate.boot.registry.StandardServiceRegistryBuilder
        Parameters:
        settingName - The name of the setting
        value - 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 class org.hibernate.boot.registry.StandardServiceRegistryBuilder
        Parameters:
        settings - The incoming settings to apply
        Returns:
        this, for method chaining
      • clearSettings

        public void clearSettings()
        Overrides:
        clearSettings in class org.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 class org.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 class org.hibernate.boot.registry.StandardServiceRegistryBuilder
        Parameters:
        serviceRole - The role of the service being added
        service - 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 class org.hibernate.boot.registry.StandardServiceRegistryBuilder
        Returns:
        this, for method chaining
      • enableAutoClose

        public org.hibernate.boot.registry.StandardServiceRegistryBuilder enableAutoClose()
        See the discussion on disableAutoClose(). This method enables the auto-closing.
        Overrides:
        enableAutoClose in class org.hibernate.boot.registry.StandardServiceRegistryBuilder
        Returns:
        this, for method chaining
      • build

        public org.hibernate.boot.registry.StandardServiceRegistry build()
        Build the StandardServiceRegistry.
        Overrides:
        build in class org.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.