Package org.hibernate.boot.registry
Class BootstrapServiceRegistryBuilder
- java.lang.Object
-
- org.hibernate.boot.registry.BootstrapServiceRegistryBuilder
-
public class BootstrapServiceRegistryBuilder extends Object
Builder forBootstrapServiceRegistryinstances. Provides registry for services needed for most operations. This includesIntegratorhandling and ClassLoader handling. Additionally responsible for building and managing theStrategySelector- See Also:
StandardServiceRegistryBuilder
-
-
Constructor Summary
Constructors Constructor Description BootstrapServiceRegistryBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BootstrapServiceRegistryBuilderapplyClassLoader(ClassLoader classLoader)Adds a providedClassLoaderfor use in class-loading and resource-lookup.BootstrapServiceRegistryBuilderapplyClassLoaderService(ClassLoaderService classLoaderService)Adds a providedClassLoaderServicefor use in class-loading and resource-lookup.BootstrapServiceRegistryBuilderapplyIntegrator(Integrator integrator)Add anIntegratorto be applied to the bootstrap registry.<T> BootstrapServiceRegistryBuilderapplyStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation)Applies a named strategy implementation to the bootstrap registry.BootstrapServiceRegistryBuilderapplyStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)Applies one or more strategy selectors announced as available by the passed announcer.voidapplyTcclLookupPrecedence(org.hibernate.boot.registry.classloading.internal.TcclLookupPrecedence precedence)Defines when the lookup in the thread contextClassLoaderis doneBootstrapServiceRegistrybuild()Build the bootstrap registry.static voiddestroy(ServiceRegistry serviceRegistry)Destroy a service registry.BootstrapServiceRegistryBuilderdisableAutoClose()By default, when a ServiceRegistry is no longer referenced by any other registries as a parent it will be closed.BootstrapServiceRegistryBuilderenableAutoClose()See the discussion ondisableAutoClose().BootstrapServiceRegistryBuilderwith(ClassLoader classLoader)Deprecated.UseapplyClassLoader(java.lang.ClassLoader)insteadBootstrapServiceRegistryBuilderwith(ClassLoaderService classLoaderService)Deprecated.BootstrapServiceRegistryBuilderwith(Integrator integrator)Deprecated.<T> BootstrapServiceRegistryBuilderwithStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation)Deprecated.BootstrapServiceRegistryBuilderwithStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)Deprecated.
-
-
-
Method Detail
-
with
@Deprecated public BootstrapServiceRegistryBuilder with(Integrator integrator)
Deprecated.
-
applyIntegrator
public BootstrapServiceRegistryBuilder applyIntegrator(Integrator integrator)
Add anIntegratorto be applied to the bootstrap registry.- Parameters:
integrator- The integrator to add.- Returns:
this, for method chaining
-
with
@Deprecated public BootstrapServiceRegistryBuilder with(ClassLoader classLoader)
Deprecated.UseapplyClassLoader(java.lang.ClassLoader)instead
-
applyClassLoader
public BootstrapServiceRegistryBuilder applyClassLoader(ClassLoader classLoader)
Adds a providedClassLoaderfor use in class-loading and resource-lookup.- Parameters:
classLoader- The class loader to use- Returns:
this, for method chaining
-
applyTcclLookupPrecedence
public void applyTcclLookupPrecedence(org.hibernate.boot.registry.classloading.internal.TcclLookupPrecedence precedence)
Defines when the lookup in the thread contextClassLoaderis done- Parameters:
precedence- The lookup precedence
-
with
@Deprecated public BootstrapServiceRegistryBuilder with(ClassLoaderService classLoaderService)
Deprecated.
-
applyClassLoaderService
public BootstrapServiceRegistryBuilder applyClassLoaderService(ClassLoaderService classLoaderService)
Adds a providedClassLoaderServicefor use in class-loading and resource-lookup.- Parameters:
classLoaderService- The class loader service to use- Returns:
this, for method chaining
-
withStrategySelector
@Deprecated public <T> BootstrapServiceRegistryBuilder withStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation)
Deprecated.
-
applyStrategySelector
public <T> BootstrapServiceRegistryBuilder applyStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation)
Applies a named strategy implementation to the bootstrap registry.- Type Parameters:
T- Defines the strategy type and makes sure that the strategy and implementation are of compatible types.- Parameters:
strategy- The strategyname- The registered nameimplementation- The strategy implementation Class- Returns:
this, for method chaining- See Also:
StrategySelector.registerStrategyImplementor(Class, String, Class)
-
withStrategySelectors
@Deprecated public BootstrapServiceRegistryBuilder withStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)
Deprecated.
-
applyStrategySelectors
public BootstrapServiceRegistryBuilder applyStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)
Applies one or more strategy selectors announced as available by the passed announcer.- Parameters:
strategyRegistrationProvider- A provider for one or more available selectors- Returns:
this, for method chaining- See Also:
StrategySelector.registerStrategyImplementor(Class, String, Class)
-
disableAutoClose
public BootstrapServiceRegistryBuilder 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.- Returns:
- this, for method chaining
-
enableAutoClose
public BootstrapServiceRegistryBuilder enableAutoClose()
See the discussion ondisableAutoClose(). This method enables the auto-closing.- Returns:
- this, for method chaining
-
build
public BootstrapServiceRegistry build()
Build the bootstrap registry.- Returns:
- The built bootstrap registry
-
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.
-
-