HHH-12894 Simplify code of StandardSessionFactoryServiceInitiators
This commit is contained in:
parent
8a8685d98e
commit
fa5f592fb9
|
@ -24,24 +24,13 @@ import org.hibernate.service.spi.SessionFactoryServiceRegistryBuilder;
|
|||
public class SessionFactoryServiceRegistryBuilderImpl implements SessionFactoryServiceRegistryBuilder {
|
||||
private final ServiceRegistryImplementor parent;
|
||||
|
||||
private final List<SessionFactoryServiceInitiator> initiators = standardInitiatorList();
|
||||
private final List<SessionFactoryServiceInitiator> initiators = StandardSessionFactoryServiceInitiators.buildStandardServiceInitiatorList();
|
||||
private final List<ProvidedService> providedServices = new ArrayList<>();
|
||||
|
||||
public SessionFactoryServiceRegistryBuilderImpl(ServiceRegistryImplementor parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used from the {@link #initiators} variable initializer
|
||||
*
|
||||
* @return List of standard initiators
|
||||
*/
|
||||
private static List<SessionFactoryServiceInitiator> standardInitiatorList() {
|
||||
final List<SessionFactoryServiceInitiator> initiators = new ArrayList<>();
|
||||
initiators.addAll( StandardSessionFactoryServiceInitiators.LIST );
|
||||
return initiators;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a service initiator.
|
||||
*
|
||||
|
|
|
@ -22,19 +22,17 @@ import org.hibernate.stat.internal.StatisticsInitiator;
|
|||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public class StandardSessionFactoryServiceInitiators {
|
||||
public static List<SessionFactoryServiceInitiator> LIST = buildStandardServiceInitiatorList();
|
||||
public final class StandardSessionFactoryServiceInitiators {
|
||||
|
||||
private static List<SessionFactoryServiceInitiator> buildStandardServiceInitiatorList() {
|
||||
final List<SessionFactoryServiceInitiator> serviceInitiators = new ArrayList<>();
|
||||
public static List<SessionFactoryServiceInitiator> buildStandardServiceInitiatorList() {
|
||||
final ArrayList<SessionFactoryServiceInitiator> serviceInitiators = new ArrayList<>();
|
||||
|
||||
serviceInitiators.add( EventListenerServiceInitiator.INSTANCE );
|
||||
serviceInitiators.add( StatisticsInitiator.INSTANCE );
|
||||
serviceInitiators.add( CacheInitiator.INSTANCE );
|
||||
|
||||
serviceInitiators.add( NativeQueryInterpreterInitiator.INSTANCE );
|
||||
|
||||
return Collections.unmodifiableList( serviceInitiators );
|
||||
return serviceInitiators;
|
||||
}
|
||||
|
||||
private StandardSessionFactoryServiceInitiators() {
|
||||
|
|
Loading…
Reference in New Issue