private void initCachePool() { try { Class factory = Class.forName(configuration.getCachingBackend().getFactoryClass()); cacheManager = ((CacheManagerFactory)factory.newInstance()).createCacheManager(configuration); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { log.warn("cache manager factory {} not found on classpath (error: {}); falling back to Guava in-memory cache backend!", configuration.getCachingBackend(), e.getMessage()); CacheManagerFactory factory = new GuavaCacheManagerFactory(); cacheManager = factory.createCacheManager(configuration); } }
if(StringUtils.isBlank(cachingBackend)){ configuration.setCachingBackend( CachingBackends.valueOf(DEFAULT_CACHING_BACKEND)); } else { try { configuration.setCachingBackend(CachingBackends.valueOf( strSubstitutor.replace(cachingBackend))); } catch (IllegalArgumentException e){ throw new ConfigurationException(CACHING_BACKEND, "Unsupported CachingBackend '" + cachingBackend + "' (supported: "+Arrays.toString(CachingBackends.values()) + ")!", e);
configuration.setClusterAddress(configurationService.getStringConfiguration(KiWiOptions.CLUSTERING_ADDRESS, "228.6.7.8")); configuration.setCachingBackend(CachingBackends.valueOf(configurationService.getStringConfiguration(KiWiOptions.CLUSTERING_BACKEND, "GUAVA"))); configuration.setCacheMode(CacheMode.valueOf(configurationService.getStringConfiguration(KiWiOptions.CLUSTERING_MODE,"LOCAL")));
configuration.setClusterAddress(configurationService.getStringConfiguration(KiWiOptions.CLUSTERING_ADDRESS, "228.6.7.8")); configuration.setCachingBackend(CachingBackends.valueOf(configurationService.getStringConfiguration(KiWiOptions.CLUSTERING_BACKEND, "GUAVA"))); configuration.setCacheMode(CacheMode.valueOf(configurationService.getStringConfiguration(KiWiOptions.CLUSTERING_MODE,"LOCAL")));
private void initCachePool() { try { Class factory = Class.forName(configuration.getCachingBackend().getFactoryClass()); cacheManager = ((CacheManagerFactory)factory.newInstance()).createCacheManager(configuration); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { log.warn("cache manager factory {} not found on classpath (error: {}); falling back to Guava in-memory cache backend!", configuration.getCachingBackend(), e.getMessage()); CacheManagerFactory factory = new GuavaCacheManagerFactory(); cacheManager = factory.createCacheManager(configuration); } }