Top Description Fields Constructors Methods
org.hibernate.boot.registry

public Class BootstrapServiceRegistryBuilder

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashSet, .LinkedHashSet, .List, .Set, org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl, .TcclLookupPrecedence, org.hibernate.boot.registry.classloading.spi.ClassLoaderService, org.hibernate.boot.registry.internal.BootstrapServiceRegistryImpl, org.hibernate.boot.registry.selector.StrategyRegistration, .StrategyRegistrationProvider, org.hibernate.boot.registry.selector.internal.StrategySelectorBuilder, org.hibernate.integrator.internal.IntegratorServiceImpl, org.hibernate.integrator.spi.Integrator, org.hibernate.service.ServiceRegistry

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 org.hibernate.boot.registry.selector.spi.StrategySelector
Authors
Steve Ebersole, Brett Meyer
See Also
StandardServiceRegistryBuilder

Field Summary

Modifier and TypeField and Description
private boolean
private List<ClassLoader>
private ClassLoaderService
private final LinkedHashSet<Integrator>
private StrategySelectorBuilder
private TcclLookupPrecedence

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public BootstrapServiceRegistryBuilder

Returns:

this, for method chaining
applyClassLoader
(ClassLoader
The class loader to use
classLoader
)

Adds a provided ClassLoader for use in class-loading and resource-lookup.

public BootstrapServiceRegistryBuilder

Returns:

this, for method chaining
applyClassLoaderService
(ClassLoaderService
The class loader service to use
classLoaderService
)

Adds a provided ClassLoaderService for use in class-loading and resource-lookup.

public BootstrapServiceRegistryBuilder

Returns:

this, for method chaining
applyIntegrator
(Integrator
The integrator to add.
integrator
)

Add an Integrator to be applied to the bootstrap registry.

public <
Defines the strategy type and makes sure that the strategy and implementation are of compatible types.
T
>
BootstrapServiceRegistryBuilder

Returns:

this, for method chaining
applyStrategySelector
(Class<T>
The strategy
strategy
,
String
The registered name
name
,
Class<? extends T>
The strategy implementation Class
implementation
)

Applies a named strategy implementation to the bootstrap registry.

public BootstrapServiceRegistryBuilder

Returns:

this, for method chaining
applyStrategySelectors
(StrategyRegistrationProvider
A provider for one or more available selectors
strategyRegistrationProvider
)

Applies one or more strategy selectors announced as available by the passed announcer.

public void
applyTcclLookupPrecedence(TcclLookupPrecedence
The lookup precedence
precedence
)

Defines when the lookup in the thread context ClassLoader is done

public BootstrapServiceRegistry

Returns:

The built bootstrap registry
build
()

Build the bootstrap registry.

public static void
destroy(ServiceRegistry
The registry to be closed.
serviceRegistry
)

Destroy a service registry.

public BootstrapServiceRegistryBuilder

Returns:

this, for method chaining
disableAutoClose
()

By default, when a ServiceRegistry is no longer referenced by any other registries as a parent it will be closed.

public BootstrapServiceRegistryBuilder

Returns:

this, for method chaining
enableAutoClose
()

See the discussion on disableAutoClose.

public BootstrapServiceRegistryBuilder
with(Integrator integrator)

Deprecated Use applyIntegrator instead
public BootstrapServiceRegistryBuilder
with(ClassLoader classLoader)

Deprecated Use applyClassLoader instead
public BootstrapServiceRegistryBuilder
with(ClassLoaderService classLoaderService)

Deprecated Use applyClassLoaderService instead
public <T> BootstrapServiceRegistryBuilder
withStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation)

Deprecated Use applyStrategySelector instead
public BootstrapServiceRegistryBuilder
withStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)

Deprecated Use applyStrategySelectors instead
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autoCloseRegistryback to summary
private boolean autoCloseRegistry
providedClassLoadersback to summary
private List<ClassLoader> providedClassLoaders
providedClassLoaderServiceback to summary
private ClassLoaderService providedClassLoaderService
providedIntegratorsback to summary
private final LinkedHashSet<Integrator> providedIntegrators
strategySelectorBuilderback to summary
private StrategySelectorBuilder strategySelectorBuilder
tcclLookupPrecedenceback to summary
private TcclLookupPrecedence tcclLookupPrecedence

Constructor Detail

BootstrapServiceRegistryBuilderback to summary
public BootstrapServiceRegistryBuilder()

Method Detail

applyClassLoaderback to summary
public BootstrapServiceRegistryBuilder applyClassLoader(ClassLoader classLoader)

Adds a provided ClassLoader for use in class-loading and resource-lookup.

Parameters
classLoader:ClassLoader

The class loader to use

Returns:BootstrapServiceRegistryBuilder

this, for method chaining

applyClassLoaderServiceback to summary
public BootstrapServiceRegistryBuilder applyClassLoaderService(ClassLoaderService classLoaderService)

Adds a provided ClassLoaderService for use in class-loading and resource-lookup.

Parameters
classLoaderService:ClassLoaderService

The class loader service to use

Returns:BootstrapServiceRegistryBuilder

this, for method chaining

applyIntegratorback to summary
public BootstrapServiceRegistryBuilder applyIntegrator(Integrator integrator)

Add an Integrator to be applied to the bootstrap registry.

Parameters
integrator:Integrator

The integrator to add.

Returns:BootstrapServiceRegistryBuilder

this, for method chaining

applyStrategySelectorback to summary
public <T> BootstrapServiceRegistryBuilder applyStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation)

Applies a named strategy implementation to the bootstrap registry.

Parameters
<T>
Defines the strategy type and makes sure that the strategy and implementation are of compatible types.
strategy:Class<T>

The strategy

name:String

The registered name

implementation:Class<? extends T>

The strategy implementation Class

Returns:BootstrapServiceRegistryBuilder

this, for method chaining

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
org.hibernate.boot.registry.selector.spi.StrategySelector#registerStrategyImplementor(Class, String, Class)
applyStrategySelectorsback to summary
public BootstrapServiceRegistryBuilder applyStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)

Applies one or more strategy selectors announced as available by the passed announcer.

Parameters
strategyRegistrationProvider:StrategyRegistrationProvider

A provider for one or more available selectors

Returns:BootstrapServiceRegistryBuilder

this, for method chaining

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
org.hibernate.boot.registry.selector.spi.StrategySelector#registerStrategyImplementor(Class, String, Class)
applyTcclLookupPrecedenceback to summary
public void applyTcclLookupPrecedence(TcclLookupPrecedence precedence)

Defines when the lookup in the thread context ClassLoader is done

Parameters
precedence:TcclLookupPrecedence

The lookup precedence

buildback to summary
public BootstrapServiceRegistry build()

Build the bootstrap registry.

Returns:BootstrapServiceRegistry

The built bootstrap registry

destroyback to summary
public static void destroy(ServiceRegistry serviceRegistry)

Destroy a service registry. Applications should only destroy registries they have explicitly created.

Parameters
serviceRegistry:ServiceRegistry

The registry to be closed.

disableAutoCloseback to summary
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:BootstrapServiceRegistryBuilder

this, for method chaining

enableAutoCloseback to summary
public BootstrapServiceRegistryBuilder enableAutoClose()

See the discussion on disableAutoClose. This method enables the auto-closing.

Returns:BootstrapServiceRegistryBuilder

this, for method chaining

withback to summary
public BootstrapServiceRegistryBuilder with(Integrator integrator)

Deprecated

Use applyIntegrator instead

Annotations
@Deprecated
withback to summary
public BootstrapServiceRegistryBuilder with(ClassLoader classLoader)

Deprecated

Use applyClassLoader instead

Annotations
@Deprecated
withback to summary
public BootstrapServiceRegistryBuilder with(ClassLoaderService classLoaderService)

Deprecated

Use applyClassLoaderService instead

Annotations
@Deprecated
withStrategySelectorback to summary
public <T> BootstrapServiceRegistryBuilder withStrategySelector(Class<T> strategy, String name, Class<? extends T> implementation)

Deprecated

Use applyStrategySelector instead

Annotations
@SuppressWarnings:UnusedDeclaration
@Deprecated
withStrategySelectorsback to summary
public BootstrapServiceRegistryBuilder withStrategySelectors(StrategyRegistrationProvider strategyRegistrationProvider)

Deprecated

Use applyStrategySelectors instead

Annotations
@SuppressWarnings:UnusedDeclaration
@Deprecated