ServiceRegistry getService - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ServiceRegistry getService method.

This code example shows how to use the following methods:getService
This code example shows how to use the following methods:getService
		return newJDBCReader( settings, revengStrategy, mdd, serviceRegistry);
	} 
 
	public static JDBCReader newJDBCReader(Settings settings, ReverseEngineeringStrategy revengStrategy, MetaDataDialect mdd,
			ServiceRegistry serviceRegistry) {
		JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
		return new JDBCReader( mdd, jdbcServices.getConnectionProvider(), jdbcServices.getSqlExceptionHelper()
				.getSqlExceptionConverter(), settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), revengStrategy );
	} 
 
	public static MetaDataDialect newMetaDataDialect(Dialect dialect, Properties cfg) {
		return new MetaDataDialectFactory().createMetaDataDialect(dialect, cfg);		
		 
	} 
	 
} 
5
CodeRank
This code example shows how to use the following methods:getService
			throw new ServiceException( "Could not initialize custom PersisterClassResolver impl [" + customImplClass.getName() + "]", e );
		} 
	} 
 
	private Class<? extends PersisterClassResolver> locate(ServiceRegistryImplementor registry, String className) {
		return registry.getService( ClassLoaderService.class ).classForName( className );
	} 
} 
4
CodeRank
This code example shows how to use the following methods:getService
			throw new ServiceException( "Could not initialize custom PersisterFactory impl [" + customImplClass.getName() + "]", e );
		} 
	} 
 
	private Class<? extends PersisterFactory> locate(ServiceRegistryImplementor registry, String className) {
		return registry.getService( ClassLoaderService.class ).classForName( className );
	} 
} 
4
CodeRank
This code example shows how to use the following methods:getService
	public TransactionFactory initiateService(Map configurationValues, ServiceRegistryImplementor registry) { 
		final Object strategy = configurationValues.get( Environment.TRANSACTION_STRATEGY ); 
		if ( TransactionFactory.class.isInstance( strategy ) ) { 
			return (TransactionFactory) strategy; 
		} 
 
		if ( strategy == null ) { 
            LOG.usingDefaultTransactionStrategy(); 
			return new JdbcTransactionFactory(); 
		} 
 
		final String strategyClassName = mapLegacyNames( strategy.toString() ); 
        LOG.transactionStrategy(strategyClassName); 
 
		ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class ); 
		try { 
			return (TransactionFactory) classLoaderService.classForName( strategyClassName ).newInstance(); 
		} 
		catch ( Exception e ) { 
			throw new HibernateException( "Unable to instantiate specified TransactionFactory class [" + strategyClassName + "]", e ); 
4
CodeRank
This code example shows how to use the following methods:getService
		catch (Exception e) {
			throw new ServiceException( "Could not build explicit BatchBuilder [" + builderClassName + "]", e );
		} 
	} 
} 
4
CodeRank
This code example shows how to use the following methods:getService
 
	// todo this shouldn't be public (nor really static): 
	// hack for org.hibernate.cfg.SettingsFactory.createRegionFactory() 
	public static String mapLegacyNames(final String name) {
		if ( "org.hibernate.cache.EhCacheRegionFactory".equals( name ) ) {
			return "org.hibernate.cache.ehcache.EhCacheRegionFactory"; 
		} 
 
		if ( "org.hibernate.cache.SingletonEhCacheRegionFactory".equals( name ) ) {
			return "org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory"; 
		} 
 
		return name;
	} 
} 
4
CodeRank
This code example shows how to use the following methods:getService
		} 
		return generatorClass; 
	} 
 
	@Override 
	public void injectServices(ServiceRegistryImplementor serviceRegistry) { 
		this.dialect = serviceRegistry.getService( JdbcServices.class ).getDialect(); 
	} 
} 
4
CodeRank
This code example shows how to use the following methods:getService
		if ( persisterClass == null ) {
			persisterClass = serviceRegistry.getService( PersisterClassResolver.class ).getEntityPersisterClass( metadata );
		} 
		return create( persisterClass, ENTITY_PERSISTER_CONSTRUCTOR_ARGS, metadata, cacheAccessStrategy, factory, cfg );
	} 
 
	@Override 
	@SuppressWarnings( {"unchecked"}) 
	public EntityPersister createEntityPersister(EntityBinding metadata,
												 EntityRegionAccessStrategy cacheAccessStrategy,
												 SessionFactoryImplementor factory,
												 Mapping cfg) {
		Class<? extends EntityPersister> persisterClass = metadata.getCustomEntityPersisterClass();
		if ( persisterClass == null ) {
			persisterClass = serviceRegistry.getService( PersisterClassResolver.class ).getEntityPersisterClass( metadata );
		} 
		return create( persisterClass, ENTITY_PERSISTER_CONSTRUCTOR_ARGS_NEW, metadata, cacheAccessStrategy, factory, cfg );
	} 
 
	// TODO: change metadata arg type to EntityBinding when new metadata is integrated 
4
CodeRank
This code example shows how to use the following methods:getService