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

net.anotheria.anoprise.cache.RoundRobinSoftReferenceCacheFactory 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;

/**
 * Factory for the RoundRobinSoftReferenceCache.
 *
 * @param  type for the key.
 * @param  type for the value.
 * @author lrosenberg
 */
public class RoundRobinSoftReferenceCacheFactory implements CacheFactory {

	@Override
	public Cache create(String name, int startSize, int maxSize) {
		return new RoundRobinSoftReferenceCache(name, startSize, maxSize);
	}

	@Override
	public ExpiringCache createExpiring(String name, int startSize, int maxSize, long expirationTime) {
		Cache> underlyingCache = new RoundRobinSoftReferenceCache(name, startSize, maxSize);
		return new ExpiringCache(name, expirationTime, underlyingCache);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy