Collection<CacheOperation> parseCachingAnnotation( AnnotatedElement ae, DefaultCacheConfig defaultConfig, Caching caching) { Collection<CacheOperation> ops = null; Cacheable[] cacheables = caching.cacheable(); if (!ObjectUtils.isEmpty(cacheables)) { ops = lazyInit(ops); for (Cacheable cacheable : cacheables) { ops.add(parseCacheableAnnotation(ae, defaultConfig, cacheable)); } } CacheEvict[] cacheEvicts = caching.evict(); if (!ObjectUtils.isEmpty(cacheEvicts)) { ops = lazyInit(ops); for (CacheEvict cacheEvict : cacheEvicts) { ops.add(parseEvictAnnotation(ae, defaultConfig, cacheEvict)); } } CachePut[] cachePuts = caching.put(); if (!ObjectUtils.isEmpty(cachePuts)) { ops = lazyInit(ops); for (CachePut cachePut : cachePuts) { ops.add(parsePutAnnotation(ae, defaultConfig, cachePut)); } } return ops; }
public static Step loadFile(String configFilePath) throws RegurgitatorException { Cache<Step> cache = Caching.getCache(Step.class); if (cache.contains(configFilePath)) { log.debug("Found cached configuration for path '" + configFilePath + "'"); return cache.get(configFilePath); } log.debug("Loading configuration from '" + configFilePath + "'"); try { String suffix = configFilePath.substring(configFilePath.lastIndexOf(".") + 1); Step step = configurationLoader(suffix).load(getInputStreamForFile(configFilePath)); log.debug("Add configuration to cache"); cache.set(configFilePath, step); return step; } catch (RegurgitatorException re) { throw re; } catch (Exception e) { throw new RegurgitatorException("Error loading regurgitator configuration", e); } }