Code example for ServiceException

0
 
		try { 
			return customImplClass.newInstance();
		} 
		catch ( Exception e ) {
			throw new ServiceException(
					"Could not initialize custom RegionFactory impl [" + customImplClass.getName() + "]", e
			); 
		} 
	} 
 
	// 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";