use of org.hibernate.boot.registry.selector.StrategyRegistration in project hibernate-orm by hibernate.
the class StrategyRegistrationProviderImpl method getStrategyRegistrations.
@Override
@SuppressWarnings("unchecked")
public Iterable<StrategyRegistration> getStrategyRegistrations() {
final List<StrategyRegistration> strategyRegistrations = new ArrayList<StrategyRegistration>();
strategyRegistrations.add(new SimpleStrategyRegistrationImpl(RegionFactory.class, EhCacheRegionFactory.class, "ehcache", EhCacheRegionFactory.class.getName(), EhCacheRegionFactory.class.getSimpleName(), // legacy impl class name
"org.hibernate.cache.EhCacheRegionFactory"));
strategyRegistrations.add(new SimpleStrategyRegistrationImpl(RegionFactory.class, SingletonEhCacheRegionFactory.class, "ehcache-singleton", SingletonEhCacheRegionFactory.class.getName(), SingletonEhCacheRegionFactory.class.getSimpleName(), // legacy impl class name
"org.hibernate.cache.SingletonEhCacheRegionFactory"));
return strategyRegistrations;
}
use of org.hibernate.boot.registry.selector.StrategyRegistration in project hibernate-orm by hibernate.
the class StrategySelectorBuilder method buildSelector.
/**
* Builds the selector.
*
* @param classLoaderService The class loading service used to (attempt to) resolve any un-registered
* strategy implementations.
*
* @return The selector.
*/
public StrategySelector buildSelector(ClassLoaderService classLoaderService) {
final StrategySelectorImpl strategySelector = new StrategySelectorImpl(classLoaderService);
// build the baseline...
addDialects(strategySelector);
addJtaPlatforms(strategySelector);
addTransactionCoordinatorBuilders(strategySelector);
addMultiTableBulkIdStrategies(strategySelector);
addEntityCopyObserverStrategies(strategySelector);
addImplicitNamingStrategies(strategySelector);
addCacheKeysFactories(strategySelector);
// apply auto-discovered registrations
for (StrategyRegistrationProvider provider : classLoaderService.loadJavaServices(StrategyRegistrationProvider.class)) {
for (StrategyRegistration discoveredStrategyRegistration : provider.getStrategyRegistrations()) {
applyFromStrategyRegistration(strategySelector, discoveredStrategyRegistration);
}
}
// apply customizations
for (StrategyRegistration explicitStrategyRegistration : explicitStrategyRegistrations) {
applyFromStrategyRegistration(strategySelector, explicitStrategyRegistration);
}
return strategySelector;
}
Aggregations