HHH-11946 Configure the Configurable services in SessionFactoryServiceRegistryImpl
This commit is contained in:
parent
67ccdae0f5
commit
345c0cce17
|
@ -9,10 +9,11 @@ package org.hibernate.service.internal;
|
|||
import java.util.List;
|
||||
|
||||
import org.hibernate.boot.spi.SessionFactoryOptions;
|
||||
import org.hibernate.engine.config.spi.ConfigurationService;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.event.service.spi.EventListenerRegistry;
|
||||
import org.hibernate.service.Service;
|
||||
import org.hibernate.service.UnknownServiceException;
|
||||
import org.hibernate.service.spi.Configurable;
|
||||
import org.hibernate.service.spi.ServiceBinding;
|
||||
import org.hibernate.service.spi.ServiceInitiator;
|
||||
import org.hibernate.service.spi.ServiceRegistryImplementor;
|
||||
|
@ -60,7 +61,9 @@ public class SessionFactoryServiceRegistryImpl extends AbstractServiceRegistryIm
|
|||
|
||||
@Override
|
||||
public <R extends Service> void configureService(ServiceBinding<R> serviceBinding) {
|
||||
//TODO nothing to do here or should we inject SessionFactory properties?
|
||||
if ( Configurable.class.isInstance( serviceBinding.getService() ) ) {
|
||||
( (Configurable) serviceBinding.getService() ).configure( getService( ConfigurationService.class ).getSettings() );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue