public class BootstrapServiceRegistryBuilder extends Object
Builder for BootstrapServiceRegistry
instances. Provides registry for services needed for
most operations. This includes Integrator
handling and ClassLoader handling.
Additionally responsible for building and managing the StrategySelector
StandardServiceRegistryBuilder
Constructor and Description |
---|
BootstrapServiceRegistryBuilder() |
Modifier and Type | Method and Description |
---|---|
BootstrapServiceRegistryBuilder |
applyClassLoader(ClassLoader classLoader)
Adds a provided
ClassLoader for use in class-loading and resource-lookup. |
BootstrapServiceRegistryBuilder |
applyClassLoaderService(ClassLoaderService classLoaderService)
Adds a provided
ClassLoaderService for use in class-loading and resource-lookup. |
BootstrapServiceRegistryBuilder |
applyIntegrator(Integrator integrator)
Add an
Integrator to be applied to the bootstrap registry. |
<T> BootstrapServiceRegistryBuilder |
applyStrategySelector(Class<T> strategy,
String name,
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 context
ClassLoader is done |
BootstrapServiceRegistry |
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 on
disableAutoClose() . |
BootstrapServiceRegistryBuilder |
with(ClassLoader classLoader)
Deprecated.
Use
applyClassLoader(java.lang.ClassLoader) instead |
BootstrapServiceRegistryBuilder |
with(ClassLoaderService classLoaderService)
Deprecated.
|
BootstrapServiceRegistryBuilder |
with(Integrator integrator)
Deprecated.
|
<T> BootstrapServiceRegistryBuilder |
withStrategySelector(Class<T> strategy,
String name,
Class<? extends T> implementation)
Deprecated.
|
BootstrapServiceRegistryBuilder |
withStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)
Deprecated.
|
@Deprecated public BootstrapServiceRegistryBuilder with(Integrator integrator)
applyIntegrator(org.hibernate.integrator.spi.Integrator)
insteadpublic BootstrapServiceRegistryBuilder applyIntegrator(Integrator integrator)
Add an Integrator
to be applied to the bootstrap registry.
integrator
- The integrator to add.this
, for method chaining@Deprecated public BootstrapServiceRegistryBuilder with(ClassLoader classLoader)
applyClassLoader(java.lang.ClassLoader)
insteadpublic BootstrapServiceRegistryBuilder applyClassLoader(ClassLoader classLoader)
Adds a provided ClassLoader
for use in class-loading and resource-lookup.
classLoader
- The class loader to usethis
, for method chainingpublic void applyTcclLookupPrecedence(org.hibernate.boot.registry.classloading.internal.TcclLookupPrecedence precedence)
Defines when the lookup in the thread context ClassLoader
is done
precedence
- The lookup precedence@Deprecated public BootstrapServiceRegistryBuilder with(ClassLoaderService classLoaderService)
applyClassLoaderService(org.hibernate.boot.registry.classloading.spi.ClassLoaderService)
insteadpublic BootstrapServiceRegistryBuilder applyClassLoaderService(ClassLoaderService classLoaderService)
Adds a provided ClassLoaderService
for use in class-loading and resource-lookup.
classLoaderService
- The class loader service to usethis
, for method chaining@Deprecated public <T> BootstrapServiceRegistryBuilder withStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation)
applyStrategySelector(java.lang.Class<T>, java.lang.String, java.lang.Class<? extends T>)
insteadpublic <T> BootstrapServiceRegistryBuilder applyStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation)
Applies a named strategy implementation to the bootstrap registry.
T
- Defines the strategy type and makes sure that the strategy and implementation are of
compatible types.strategy
- The strategyname
- The registered nameimplementation
- The strategy implementation Classthis
, for method chainingStrategySelector.registerStrategyImplementor(Class, String, Class)
@Deprecated public BootstrapServiceRegistryBuilder withStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)
applyStrategySelectors(org.hibernate.boot.registry.selector.StrategyRegistrationProvider)
insteadpublic BootstrapServiceRegistryBuilder applyStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)
Applies one or more strategy selectors announced as available by the passed announcer.
strategyRegistrationProvider
- A provider for one or more available selectorsthis
, for method chainingStrategySelector.registerStrategyImplementor(Class, String, Class)
public BootstrapServiceRegistryBuilder disableAutoClose()
By default, when a ServiceRegistry is no longer referenced by any other registries as a parent it will be closed. <p/> Some applications that explicitly build "shared registries" may want to circumvent that behavior. <p/> This method indicates that the registry being built should not be automatically closed. The caller agrees to take responsibility to close it themselves.
public BootstrapServiceRegistryBuilder enableAutoClose()
See the discussion on disableAutoClose()
. This method enables
the auto-closing.
public BootstrapServiceRegistry build()
Build the bootstrap registry.
public static void destroy(ServiceRegistry serviceRegistry)
Destroy a service registry. Applications should only destroy registries they have explicitly created.
serviceRegistry
- The registry to be closed.Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.