package nl.siegmann.ehcachetag;

import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;

/**
 * Wrapper around the CacheManager that makes it easier to mock the CacheManager.
 * 
 * @author paul
 *
 */
class ContentCache {

	public static final String NO_CACHED_VALUE = new String();
	
	public Object getContent(String cacheName, Object cacheKey) {
		Element cacheElement = CacheManager.getInstance().getCache(cacheName).get(cacheKey);
		if (cacheElement == null) {
			return NO_CACHED_VALUE;
		}
		return cacheElement.getObjectValue();
	}
	
	public void putContent(String cacheName, Object cacheKey, String cacheValue) {
		CacheManager.getInstance().getCache(cacheName).put(new Element(cacheKey, cacheValue));
	}
}
@@ -26,16 +26,46 @@
 hetag;%0A%0A
+import java.io.Serializable;%0A%0A
 import n
@@ -256,17 +256,126 @@
 ntCache 
-%7B
+implements Serializable %7B%0A%0A%09/**%0A%09 * %0A%09 */%0A%09private static final long serialVersionUID = -3991729685862770264L;
 %0A%0A%09publi

make ContentCache Serializable