Package org.hibernate.boot.registry
Class BootstrapServiceRegistryBuilder
- java.lang.Object
-
- org.hibernate.boot.registry.BootstrapServiceRegistryBuilder
-
public class BootstrapServiceRegistryBuilder extends java.lang.Object
Builder forBootstrapServiceRegistry
instances. Provides registry for services needed for most operations. This includesIntegrator
handling 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 BootstrapServiceRegistryBuilder
applyClassLoader(java.lang.ClassLoader classLoader)
Adds a providedClassLoader
for use in class-loading and resource-lookup.BootstrapServiceRegistryBuilder
applyClassLoaderService(ClassLoaderService classLoaderService)
Adds a providedClassLoaderService
for use in class-loading and resource-lookup.BootstrapServiceRegistryBuilder
applyIntegrator(Integrator integrator)
Add anIntegrator
to be applied to the bootstrap registry.<T> BootstrapServiceRegistryBuilder
applyStrategySelector(java.lang.Class<T> strategy, java.lang.String name, java.lang.Class<? extends T> implementation)
Applies a named strategy implementation to the bootstrap registry.BootstrapServiceRegistryBuilder
applyStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)
Applies one or more strategy selectors announced as available by the passed announcer.void
applyTcclLookupPrecedence(org.hibernate.boot.registry.classloading.internal.TcclLookupPrecedence precedence)
Defines when the lookup in the thread contextClassLoader
is doneBootstrapServiceRegistry
build()
Build the bootstrap registry.static void
destroy(ServiceRegistry serviceRegistry)
Destroy a service registry.BootstrapServiceRegistryBuilder
disableAutoClose()
By default, when a ServiceRegistry is no longer referenced by any other registries as a parent it will be closed.BootstrapServiceRegistryBuilder
enableAutoClose()
See the discussion ondisableAutoClose()
.BootstrapServiceRegistryBuilder
with(java.lang.ClassLoader classLoader)
Deprecated.UseapplyClassLoader(java.lang.ClassLoader)
insteadBootstrapServiceRegistryBuilder
with(ClassLoaderService classLoaderService)
Deprecated.BootstrapServiceRegistryBuilder
with(Integrator integrator)
Deprecated.<T> BootstrapServiceRegistryBuilder
withStrategySelector(java.lang.Class<T> strategy, java.lang.String name, java.lang.Class<? extends T> implementation)
Deprecated.BootstrapServiceRegistryBuilder
withStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)
Deprecated.
-
-
-
Method Detail
-
with
@Deprecated public BootstrapServiceRegistryBuilder with(Integrator integrator)
Deprecated.
-
applyIntegrator
public BootstrapServiceRegistryBuilder applyIntegrator(Integrator integrator)
Add anIntegrator
to be applied to the bootstrap registry.- Parameters:
integrator
- The integrator to add.- Returns:
this
, for method chaining
-
with
@Deprecated public BootstrapServiceRegistryBuilder with(java.lang.ClassLoader classLoader)
Deprecated.UseapplyClassLoader(java.lang.ClassLoader)
instead
-
applyClassLoader
public BootstrapServiceRegistryBuilder applyClassLoader(java.lang.ClassLoader classLoader)
Adds a providedClassLoader
for 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 contextClassLoader
is done- Parameters:
precedence
- The lookup precedence
-
with
@Deprecated public BootstrapServiceRegistryBuilder with(ClassLoaderService classLoaderService)
Deprecated.
-
applyClassLoaderService
public BootstrapServiceRegistryBuilder applyClassLoaderService(ClassLoaderService classLoaderService)
Adds a providedClassLoaderService
for 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(java.lang.Class<T> strategy, java.lang.String name, java.lang.Class<? extends T> implementation)
Deprecated.
-
applyStrategySelector
public <T> BootstrapServiceRegistryBuilder applyStrategySelector(java.lang.Class<T> strategy, java.lang.String name, java.lang.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.
-
-