List of usage examples for com.liferay.portal.kernel.webcache WebCachePoolUtil remove
public static void remove(String key)
From source file:com.liferay.stocks.util.StocksUtil.java
License:Open Source License
public static Stocks getStocks(String symbol) { WebCacheItem wci = new StocksWebCacheItem(symbol); String key = StocksUtil.class.getName() + StringPool.PERIOD + symbol; try {/*from w w w . ja v a2 s .c o m*/ return (Stocks) WebCachePoolUtil.get(key, wci); } catch (ClassCastException cce) { WebCachePoolUtil.remove(key); return (Stocks) WebCachePoolUtil.get(key, wci); } }
From source file:com.liferay.tich.util.TICHUtil.java
License:Open Source License
public static List<Event> getEvents() { WebCacheItem wci = new EventsWebCacheItem(); String key = TICHUtil.class.getName(); List<Event> events = (List<Event>) WebCachePoolUtil.get(key, wci); try {/*from ww w.ja v a 2 s . com*/ if (events.size() > 0) { Event event = events.get(0); } } catch (ClassCastException cce) { WebCachePoolUtil.remove(key); events = (List<Event>) WebCachePoolUtil.get(key, wci); } return events; }
From source file:com.liferay.weather.util.WeatherUtil.java
License:Open Source License
public static Weather getWeather(String zip) { String key = WeatherUtil.class.getName() + StringPool.PERIOD + zip; WebCacheItem wci = new WeatherWebCacheItem(zip); try {/* ww w.jav a2 s .com*/ return (Weather) WebCachePoolUtil.get(key, wci); } catch (ClassCastException cce) { WebCachePoolUtil.remove(key); return (Weather) WebCachePoolUtil.get(key, wci); } }