@Configuration(proxyBeanMethods=false)
@ConditionalOnClass(value=net.jodah.expiringmap.ExpiringMap.class)
@ConditionalOnProperty(name="assembly.cache.client",
havingValue="expire_map",
matchIfMissing=true)
public class ExpiringMapConfiguration
extends CacheCommonsConfiguration
implements CacheBannerDisplayDevice, org.springframework.context.EnvironmentAware
ExpiringMap
The following is an explanation of important parameters
CacheProperties.getExpiringMap().Max Size : the maximum length of the map, add the 1001 th entry, can lead to the first expired
immediately (even if not to expiration time).Expiration : expiration time and expired unit, set the expiration time, is permanent.CREATED: when each update element, the countdown reset date.ACCESSED : in every visit elements, the countdown reset date.Variable Expiration : allows you to update the Expiration time value, if not set variable Expiration.UnsupportedOperationException.Expiration Listener : Synchronous listener , Need to implement ExpirationListener
and annotate SyncListener to achieve synchronous expiration notification.Async Expiration Listener : Asynchronous listener , Need to implement ExpirationListener
and annotate AsyncListener to achieve synchronous expiration notification.Entry Loader : lazy loading, if the key does not exist when calling the get method to create
the default value.
Provide a configuration for you to load relevant build configurations related to ExpiringMap,
and select this cache configuration to load and use in the main assembly class by default.
properties| 构造器和说明 |
|---|
ExpiringMapConfiguration(CacheProperties properties) |
| 限定符和类型 | 方法和说明 |
|---|---|
top.osjf.assembly.cache.factory.CacheFactory |
cacheExecutorFactory(org.springframework.beans.factory.ObjectProvider<top.osjf.assembly.cache.config.expiringmap.ExpiringMapClientsCustomizer> buildCustomizer) |
top.osjf.assembly.cache.config.expiringmap.ExpiringMapClientsCustomizer |
expireMapClientCustomizer() |
Map<String,List<net.jodah.expiringmap.ExpirationListener>> |
findExpirationListener()
Find a listening class that carries
SyncListener or AsyncListener in the specified path,
as it needs to be instantiated. |
org.springframework.core.env.Environment |
getEnvironment() |
Class<?> |
getSourceClass()
Obtain a resource class object that can obtain the version.
|
StartUpBanner |
getStartUpBanner()
Obtain a
StartUpBanner implementation class. |
void |
printBanner(org.springframework.core.env.Environment environment,
Class<?> sourceClass,
PrintStream out) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
getPropertiesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterPropertiesSetpublic ExpiringMapConfiguration(CacheProperties properties)
public void printBanner(org.springframework.core.env.Environment environment,
Class<?> sourceClass,
PrintStream out)
printBanner 在接口中 org.springframework.boot.BannerprintBanner 在接口中 CacheBannerDisplayDevicepublic void setEnvironment(@NotNull
org.springframework.core.env.Environment environment)
setEnvironment 在接口中 org.springframework.context.EnvironmentAware@NotNull public org.springframework.core.env.Environment getEnvironment()
getEnvironment 在接口中 org.springframework.core.env.EnvironmentCapablegetEnvironment 在接口中 CacheBannerDisplayDevice@NotNull public Class<?> getSourceClass()
CacheBannerDisplayDeviceIf it is the original, it defaults to CacheVersion to obtain the version of this project.
getSourceClass 在接口中 CacheBannerDisplayDevice@NotNull public StartUpBanner getStartUpBanner()
CacheBannerDisplayDeviceStartUpBanner implementation class.getStartUpBanner 在接口中 CacheBannerDisplayDeviceStartUpBanner associated with this assembly.@Bean(value="expiringMap::cacheExecutorFactory") @ConditionalOnMissingBean(value=top.osjf.assembly.cache.factory.CacheFactory.class) public top.osjf.assembly.cache.factory.CacheFactory cacheExecutorFactory(org.springframework.beans.factory.ObjectProvider<top.osjf.assembly.cache.config.expiringmap.ExpiringMapClientsCustomizer> buildCustomizer)
@Bean(value="expiringMap::expireMapClientCustomizer") public top.osjf.assembly.cache.config.expiringmap.ExpiringMapClientsCustomizer expireMapClientCustomizer()
public Map<String,List<net.jodah.expiringmap.ExpirationListener>> findExpirationListener()
SyncListener or AsyncListener in the specified path,
as it needs to be instantiated.
If an interface or abstract class is scanned, it will be scanned for its implementation self class.
If it is not, it will not be possible to add listening.
Copyright © 2023. All rights reserved.