/** * Constructs a StandardServiceRegistryImpl. Should not be instantiated directly; use * {@link org.hibernate.boot.registry.StandardServiceRegistryBuilder} instead * * @param autoCloseRegistry See discussion on * {@link org.hibernate.boot.registry.StandardServiceRegistryBuilder#disableAutoClose} * @param bootstrapServiceRegistry The bootstrap service registry. * @param serviceInitiators Any StandardServiceInitiators provided by the user to the builder * @param providedServices Any standard services provided directly to the builder * @param configurationValues Configuration values * * @see org.hibernate.boot.registry.StandardServiceRegistryBuilder */ @SuppressWarnings( {"unchecked"}) public StandardServiceRegistryImpl( boolean autoCloseRegistry, BootstrapServiceRegistry bootstrapServiceRegistry, List<StandardServiceInitiator> serviceInitiators, List<ProvidedService> providedServices, Map<?, ?> configurationValues) { super( bootstrapServiceRegistry, autoCloseRegistry ); this.configurationValues = configurationValues; // process initiators for ( ServiceInitiator initiator : serviceInitiators ) { createServiceBinding( initiator ); } // then, explicitly provided service instances for ( ProvidedService providedService : providedServices ) { createServiceBinding( providedService ); } }
private static List<StandardServiceInitiator> buildStandardServiceInitiatorList() { final List<StandardServiceInitiator> serviceInitiators = new ArrayList<StandardServiceInitiator>(); serviceInitiators.add( ConfigurationServiceInitiator.INSTANCE ); serviceInitiators.add( ImportSqlCommandExtractorInitiator.INSTANCE ); serviceInitiators.add( JndiServiceInitiator.INSTANCE ); serviceInitiators.add( JmxServiceInitiator.INSTANCE ); serviceInitiators.add( PersisterClassResolverInitiator.INSTANCE ); serviceInitiators.add( PersisterFactoryInitiator.INSTANCE ); serviceInitiators.add( ConnectionProviderInitiator.INSTANCE ); serviceInitiators.add( MultiTenantConnectionProviderInitiator.INSTANCE ); serviceInitiators.add( DialectResolverInitiator.INSTANCE ); serviceInitiators.add( DialectFactoryInitiator.INSTANCE ); serviceInitiators.add( BatchBuilderInitiator.INSTANCE ); serviceInitiators.add( JdbcServicesInitiator.INSTANCE ); serviceInitiators.add( RefCursorSupportInitiator.INSTANCE ); serviceInitiators.add( MutableIdentifierGeneratorFactoryInitiator.INSTANCE); serviceInitiators.add( JtaPlatformResolverInitiator.INSTANCE ); serviceInitiators.add( JtaPlatformInitiator.INSTANCE ); serviceInitiators.add( TransactionFactoryInitiator.INSTANCE ); serviceInitiators.add( SessionFactoryServiceRegistryFactoryInitiator.INSTANCE ); serviceInitiators.add( RegionFactoryInitiator.INSTANCE ); return Collections.unmodifiableList( serviceInitiators ); }
@Override public ServiceRegistryBuilder addInitiator(StandardServiceInitiator initiator) { super.addInitiator( initiator ); return this; }
@Override public <R extends Service> R initiateService(ServiceInitiator<R> serviceInitiator) { // todo : add check/error for unexpected initiator types? return ( (StandardServiceInitiator<R>) serviceInitiator ).initiateService( configurationValues, this ); }
/** * Constructs a StandardServiceRegistryImpl. Should not be instantiated directly; use * {@link org.hibernate.boot.registry.StandardServiceRegistryBuilder} instead * * @param bootstrapServiceRegistry The bootstrap service registry. * @param serviceInitiators Any StandardServiceInitiators provided by the user to the builder * @param providedServices Any standard services provided directly to the builder * @param configurationValues Configuration values * * @see org.hibernate.boot.registry.StandardServiceRegistryBuilder */ @SuppressWarnings( {"unchecked"}) public StandardServiceRegistryImpl( BootstrapServiceRegistry bootstrapServiceRegistry, List<StandardServiceInitiator> serviceInitiators, List<ProvidedService> providedServices, Map<?, ?> configurationValues) { this( true, bootstrapServiceRegistry, serviceInitiators, providedServices, configurationValues ); }