12.5.4. The ServiceRegistry
12.5.4.1. About the ServiceRegistry
The central service API, aside from the services themselves, is the
org.hibernate.service.ServiceRegistry
interface. The main purpose of a service registry is to hold, manage and provide access to services.
Service registries are hierarchical. Services in one registry can depend on and utilize services in that same registry as well as any parent registries.
Use
org.hibernate.service.ServiceRegistryBuilder
to build a org.hibernate.service.ServiceRegistry
instance.
Example 12.21. Use ServiceRegistryBuilder to create a ServiceRegistry
ServiceRegistryBuilder registryBuilder = new ServiceRegistryBuilder( bootstrapServiceRegistry ); ServiceRegistry serviceRegistry = registryBuilder.buildServiceRegistry();