
com.boot.auth.starter.support.GuavaCacheSupport Maven / Gradle / Ivy
package com.boot.auth.starter.support;
import com.boot.auth.starter.common.AuthProperties;
import com.boot.auth.starter.common.RestStatus;
import com.boot.auth.starter.exception.AuthException;
import com.google.common.cache.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
/**
* 基于 guava 的缓存
* 2023/6/3 12:45
*
* @author liucheng
* @version 1.0
*/
@Scope
@Component
public class GuavaCacheSupport {
private final static Logger log = LoggerFactory.getLogger(GuavaCacheSupport.class);
final
AuthProperties authProperties;
public GuavaCacheSupport(AuthProperties authProperties) {
this.authProperties = authProperties;
}
private final int CPU_N = Runtime.getRuntime().availableProcessors();
private Cache
© 2015 - 2025 Weber Informatics LLC | Privacy Policy