
/**
 * 
 */
package org.tio.sitexxx.view.topic;

import org.redisson.api.listener.MessageListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tio.sitexxx.service.cache.CacheConfig;
import org.tio.sitexxx.service.cache.Caches;
import org.tio.sitexxx.service.vo.topic.CleanViewCacheVo;
import org.tio.sitexxx.view.http.WebViewInit;
import org.tio.utils.cache.ICache;

/**
 * @author tanyaowu
 *
 */
public class TopicCleanViewCacheListener implements MessageListener<CleanViewCacheVo> {

	private static Logger log = LoggerFactory.getLogger(TopicCleanViewCacheListener.class);

	public static final TopicCleanViewCacheListener me = new TopicCleanViewCacheListener();

	@Override
	public void onMessage(CharSequence channel, CleanViewCacheVo cleanViewCacheVo) {
		try {
			ICache cache = Caches.getCache(CacheConfig.VIEW_HTML);
			cache.clear();
		} catch (Exception e) {
			log.error("", e);
		}

		WebViewInit.requestHandler.clearStaticResCache();
	}

}
