Search in sources :

Example 1 with RepositoryCache

use of com.evolveum.midpoint.repo.cache.RepositoryCache 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;
}
Also used : SystemException(com.evolveum.midpoint.util.exception.SystemException) RepositoryServiceFactory(com.evolveum.midpoint.repo.api.RepositoryServiceFactory) RepositoryCache(com.evolveum.midpoint.repo.cache.RepositoryCache) BeansException(org.springframework.beans.BeansException) SystemException(com.evolveum.midpoint.util.exception.SystemException) RepositoryServiceFactoryException(com.evolveum.midpoint.repo.api.RepositoryServiceFactoryException)

Aggregations

RepositoryServiceFactory (com.evolveum.midpoint.repo.api.RepositoryServiceFactory)1 RepositoryServiceFactoryException (com.evolveum.midpoint.repo.api.RepositoryServiceFactoryException)1 RepositoryCache (com.evolveum.midpoint.repo.cache.RepositoryCache)1 SystemException (com.evolveum.midpoint.util.exception.SystemException)1 BeansException (org.springframework.beans.BeansException)1