use of com.evolveum.midpoint.repo.api.RepositoryServiceFactory in project midpoint by Evolveum.
the class RepositoryFactory method init.
public void init() {
Configuration config = midpointConfiguration.getConfiguration(REPOSITORY_CONFIGURATION);
try {
String className = getFactoryClassName(config);
LOGGER.info("Repository factory class name from configuration '{}'.", new Object[] { className });
Class<RepositoryServiceFactory> clazz = (Class<RepositoryServiceFactory>) Class.forName(className);
factory = getFactoryBean(clazz);
factory.init(config);
} catch (Exception ex) {
LoggingUtils.logException(LOGGER, "RepositoryServiceFactory implementation class {} failed to " + "initialize.", ex, config.getString(REPOSITORY_FACTORY_CLASS));
throw new SystemException("RepositoryServiceFactory implementation class " + config.getString(REPOSITORY_FACTORY_CLASS) + " failed to initialize: " + ex.getMessage(), ex);
}
}
use of com.evolveum.midpoint.repo.api.RepositoryServiceFactory in project midpoint by Evolveum.
the class RepositoryFactory method getCacheRepositoryService.
public synchronized RepositoryService getCacheRepositoryService() {
if (cacheRepositoryService == null) {
try {
Class<RepositoryServiceFactory> clazz = (Class<RepositoryServiceFactory>) Class.forName(REPOSITORY_FACTORY_CACHE_CLASS);
cacheFactory = getFactoryBean(clazz);
//TODO decompose this dependency, remove class casting !!!
RepositoryCache repositoryCache = (RepositoryCache) cacheFactory.getRepositoryService();
repositoryCache.setRepository(getRepositoryService(), prismContext);
cacheRepositoryService = repositoryCache;
} catch (Exception ex) {
LoggingUtils.logException(LOGGER, "Failed to get cache repository service. ExceptionClass = {}", ex, ex.getClass().getName());
throw new SystemException("Failed to get cache repository service", ex);
}
}
return cacheRepositoryService;
}
Aggregations