类org.hibernate.integrator.spi.IntegratorService源码实例Demo

下面列出了怎么用org.hibernate.integrator.spi.IntegratorService的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lams   文件: BootstrapServiceRegistryImpl.java
/**
 * Constructs a BootstrapServiceRegistryImpl.
 *
 * Do not use directly generally speaking.  Use {@link org.hibernate.boot.registry.BootstrapServiceRegistryBuilder}
 * instead.
 *
 * @param autoCloseRegistry See discussion on
 * {@link org.hibernate.boot.registry.BootstrapServiceRegistryBuilder#disableAutoClose}
 * @param classLoaderService The ClassLoaderService to use
 * @param providedIntegrators The group of explicitly provided integrators
 *
 * @see org.hibernate.boot.registry.BootstrapServiceRegistryBuilder
 */
public BootstrapServiceRegistryImpl(
		boolean autoCloseRegistry,
		ClassLoaderService classLoaderService,
		LinkedHashSet<Integrator> providedIntegrators) {
	this.autoCloseRegistry = autoCloseRegistry;

	this.classLoaderServiceBinding = new ServiceBinding<ClassLoaderService>(
			this,
			ClassLoaderService.class,
			classLoaderService
	);

	final StrategySelectorImpl strategySelector = new StrategySelectorImpl( classLoaderService );
	this.strategySelectorBinding = new ServiceBinding<StrategySelector>(
			this,
			StrategySelector.class,
			strategySelector
	);

	this.integratorServiceBinding = new ServiceBinding<IntegratorService>(
			this,
			IntegratorService.class,
			new IntegratorServiceImpl( providedIntegrators, classLoaderService )
	);
}
 
源代码2 项目: lams   文件: BootstrapServiceRegistryImpl.java
/**
 * Constructs a BootstrapServiceRegistryImpl.
 *
 * Do not use directly generally speaking.  Use {@link org.hibernate.boot.registry.BootstrapServiceRegistryBuilder}
 * instead.
 *
 * @param autoCloseRegistry See discussion on
 * {@link org.hibernate.boot.registry.BootstrapServiceRegistryBuilder#disableAutoClose}
 * @param classLoaderService The ClassLoaderService to use
 * @param strategySelector The StrategySelector to use
 * @param integratorService The IntegratorService to use
 *
 * @see org.hibernate.boot.registry.BootstrapServiceRegistryBuilder
 */
public BootstrapServiceRegistryImpl(
		boolean autoCloseRegistry,
		ClassLoaderService classLoaderService,
		StrategySelector strategySelector,
		IntegratorService integratorService) {
	this.autoCloseRegistry = autoCloseRegistry;

	this.classLoaderServiceBinding = new ServiceBinding<ClassLoaderService>(
			this,
			ClassLoaderService.class,
			classLoaderService
	);

	this.strategySelectorBinding = new ServiceBinding<StrategySelector>(
			this,
			StrategySelector.class,
			strategySelector
	);

	this.integratorServiceBinding = new ServiceBinding<IntegratorService>(
			this,
			IntegratorService.class,
			integratorService
	);
}
 
@SuppressWarnings("deprecation")
private void applyServiceContributingIntegrators() {
    for ( Integrator integrator : bootstrapServiceRegistry.getService( IntegratorService.class )
            .getIntegrators() ) {
        if (integrator instanceof ServiceContributingIntegrator) {
            ((ServiceContributingIntegrator) integrator).prepareServices( this );
        }
    }
}
 
源代码4 项目: lams   文件: StandardServiceRegistryBuilder.java
@SuppressWarnings("deprecation")
private void applyServiceContributingIntegrators() {
	for ( Integrator integrator : bootstrapServiceRegistry.getService( IntegratorService.class )
			.getIntegrators() ) {
		if ( org.hibernate.integrator.spi.ServiceContributingIntegrator.class.isInstance( integrator ) ) {
			org.hibernate.integrator.spi.ServiceContributingIntegrator.class.cast( integrator ).prepareServices(
					this );
		}
	}
}
 
源代码5 项目: lams   文件: BootstrapServiceRegistryImpl.java
@Override
@SuppressWarnings( {"unchecked"})
public <R extends Service> ServiceBinding<R> locateServiceBinding(Class<R> serviceRole) {
	if ( ClassLoaderService.class.equals( serviceRole ) ) {
		return (ServiceBinding<R>) classLoaderServiceBinding;
	}
	else if ( StrategySelector.class.equals( serviceRole) ) {
		return (ServiceBinding<R>) strategySelectorBinding;
	}
	else if ( IntegratorService.class.equals( serviceRole ) ) {
		return (ServiceBinding<R>) integratorServiceBinding;
	}

	return null;
}
 
源代码6 项目: gorm-hibernate5   文件: HibernateDatastore.java
private Metadata getMetadataInternal() {
    Metadata metadata = null;
    ServiceRegistry bootstrapServiceRegistry = ((SessionFactoryImplementor) sessionFactory).getServiceRegistry().getParentServiceRegistry();
    Iterable<Integrator> integrators = bootstrapServiceRegistry.getService(IntegratorService.class).getIntegrators();
    for (Integrator integrator : integrators) {
        if (integrator instanceof MetadataIntegrator) {
            metadata = ((MetadataIntegrator) integrator).getMetadata();
        }
    }
    return metadata;
}
 
源代码7 项目: lams   文件: BootstrapServiceRegistryImpl.java
/**
 * Constructs a BootstrapServiceRegistryImpl.
 *
 * Do not use directly generally speaking.  Use {@link org.hibernate.boot.registry.BootstrapServiceRegistryBuilder}
 * instead.
 *
 * @param classLoaderService The ClassLoaderService to use
 * @param strategySelector The StrategySelector to use
 * @param integratorService The IntegratorService to use
 *
 * @see org.hibernate.boot.registry.BootstrapServiceRegistryBuilder
 */
public BootstrapServiceRegistryImpl(
		ClassLoaderService classLoaderService,
		StrategySelector strategySelector,
		IntegratorService integratorService) {
	this( true, classLoaderService, strategySelector, integratorService );
}
 
 类所在包
 类方法
 同包方法