// consultar si el resultado est� en la cache
try {
Map<Integer, Integer> props = new HashMap<Integer, Integer>();
props.put(GCacheFactory.EXPIRATION_DELTA, 1800);
CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory();
Cache cache = cacheFactory.createCache(Collections.emptyMap());
List<FeaturedArticle> articles = (List<FeaturedArticle>) cache.get(FEATURED_ARTICLES_KEY);
if (articles == null) {
// si no esta, buscar los 5 art�culos con m�s comentarios
articles = searchFeaturedArticles();
// guardar el resultado en la cache
cache.put(FEATURED_ARTICLES_KEY, articles);
}
return articles;
} catch (CacheException e) {
System.out.println(e);
return Collections.EMPTY_LIST;