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

io.milton.cache.LocalCacheManager Maven / Gradle / Ivy

Go to download

Milton Community Edition: Supports DAV level 1 and is available on Apache2 license

There is a newer version: 4.0.3.2215
Show newest version
/*
 *       Copyright McEvoy Software Ltd
 */
package io.milton.cache;

import java.util.Map;

import com.github.benmanes.caffeine.cache.Caffeine;

/**
 * Attempts to connect to a hazelcast cluster. To use this, be sure to include
 * the optional hazelcast dependencies
 *
 * @author brad
 */
public class LocalCacheManager implements CacheManager {

	private int maximumWeightedCapacity = 1000;

    public LocalCacheManager() {
    }


	@Override
    public Map getMap(String name) {
        return Caffeine.newBuilder()
                .maximumSize(maximumWeightedCapacity)
                .build().asMap();
    }

	public int getMaximumWeightedCapacity() {
		return maximumWeightedCapacity;
	}

	public void setMaximumWeightedCapacity(int maximumWeightedCapacity) {
		this.maximumWeightedCapacity = maximumWeightedCapacity;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy