Search in sources :

Example 1 with SessionFactoryServiceContributor

use of org.hibernate.service.spi.SessionFactoryServiceContributor in project hibernate-orm by hibernate.

the class SessionFactoryServiceRegistryFactoryImpl method buildServiceRegistry.

@Override
public SessionFactoryServiceRegistry buildServiceRegistry(SessionFactoryImplementor sessionFactory, SessionFactoryOptions options) {
    final ClassLoaderService cls = options.getServiceRegistry().getService(ClassLoaderService.class);
    final SessionFactoryServiceRegistryBuilderImpl builder = new SessionFactoryServiceRegistryBuilderImpl(theBasicServiceRegistry);
    for (SessionFactoryServiceContributor contributor : cls.loadJavaServices(SessionFactoryServiceContributor.class)) {
        contributor.contribute(builder);
    }
    return builder.buildSessionFactoryServiceRegistry(sessionFactory, options);
}
Also used : SessionFactoryServiceContributor(org.hibernate.service.spi.SessionFactoryServiceContributor) ClassLoaderService(org.hibernate.boot.registry.classloading.spi.ClassLoaderService)

Aggregations

ClassLoaderService (org.hibernate.boot.registry.classloading.spi.ClassLoaderService)1 SessionFactoryServiceContributor (org.hibernate.service.spi.SessionFactoryServiceContributor)1