All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rs.mail.templates.cache.CacheManager Maven / Gradle / Ivy

/**
 * 
 */
package rs.mail.templates.cache;

import java.util.Map;

import rs.mail.templates.cache.impl.CacheEntryMeta;

/**
 * A cache manager is responsible to cleanup a cache to prevent from consuming to much memory.
 * 
 * @author ralph
 *
 */
public interface CacheManager {

	/**
	 * Return the size of cache that triggers a cleanup.
	 * @return the size of cache that triggers a cleanup
	 */
	public int getCleanupThreshold();

	/**
	 * Returns the time in ms between two cleanup tasks.
	 * @return the time in ms between two cleanup tasks
	 */
	public long getMinCleanupLapse();
	
	/**
	 * Performs a cleanup task.
	 * @param  the key type of the cache
	 * @param  the value type of the cache
	 * @param cache the cache that requires the cleanup
	 * @param meta the meta data of the cache
	 */
	public  void cleanup(Cache cache, Map> meta);
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy