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

net.anotheria.anoprise.cache.CacheFactory Maven / Gradle / Ivy

Go to download

Collection of utils for different enterprise class projects. Among other stuff contains Caches, Mocking, DualCrud, MetaFactory and SessionDistributorService. Visit https://opensource.anotheria.net for details.

There is a newer version: 4.0.0
Show newest version
package net.anotheria.anoprise.cache;

/**
 * Defines a factory for caches.
 *
 * @param  cache key.
 * @param  cache value.
 * @author lrosenberg
 */
public interface CacheFactory {
	/**
	 * Creates a new cache with given name, start and max size.
	 *
	 * @param name	  name of the cache.
	 * @param startSize start size of the cache.
	 * @param maxSize   max size of the cache.
	 * @return created cache object.
	 */
	Cache create(String name, int startSize, int maxSize);

	/**
	 * Creates a new expiring cache with given name, start and max size, expiration time
	 *
	 * @param name		   name of the cache
	 * @param startSize	  start size of the cache
	 * @param maxSize		max size of the cache
	 * @param expirationTime expiration time of the cache elements
	 * @return created cache object
	 */
	ExpiringCache createExpiring(String name, int startSize, int maxSize, long expirationTime);
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy