类 ReferenceConfigCache
- java.lang.Object
-
- com.alibaba.dubbo.config.utils.ReferenceConfigCache
-
public class ReferenceConfigCache extends Object
a simple util class for cacheReferenceConfig.ReferenceConfigis a heavy Object, it's necessary to cache these object for the framework which createReferenceConfigfrequently.You can implement and use your own
ReferenceConfigcache if you need use complicate strategy.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interfaceReferenceConfigCache.KeyGenerator
-
字段概要
字段 修饰符和类型 字段 说明 static ReferenceConfigCache.KeyGeneratorDEFAULT_KEY_GENERATORCreate the key with the Group, Interface and version attribute ofReferenceConfig.static StringDEFAULT_NAME
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 <T> voiddestroy(ReferenceConfig<T> referenceConfig)clear and destroy oneReferenceConfigin the cache.voiddestroyAll()clear and destroy allReferenceConfigin the cache.<T> Tget(ReferenceConfig<T> referenceConfig)static ReferenceConfigCachegetCache()Get the cache use default name andDEFAULT_KEY_GENERATORto generate cache key.static ReferenceConfigCachegetCache(String name)Get the cache use specified name andReferenceConfigCache.KeyGenerator.static ReferenceConfigCachegetCache(String name, ReferenceConfigCache.KeyGenerator keyGenerator)Get the cache use specifiedReferenceConfigCache.KeyGenerator.StringtoString()
-
-
-
字段详细资料
-
DEFAULT_KEY_GENERATOR
public static final ReferenceConfigCache.KeyGenerator DEFAULT_KEY_GENERATOR
Create the key with the Group, Interface and version attribute ofReferenceConfig.key example:
group1/com.alibaba.foo.FooService:1.0.0.
-
-
方法详细资料
-
getCache
public static ReferenceConfigCache getCache()
Get the cache use default name andDEFAULT_KEY_GENERATORto generate cache key. Create cache if not existed yet.
-
getCache
public static ReferenceConfigCache getCache(String name)
Get the cache use specified name andReferenceConfigCache.KeyGenerator. Create cache if not existed yet.
-
getCache
public static ReferenceConfigCache getCache(String name, ReferenceConfigCache.KeyGenerator keyGenerator)
Get the cache use specifiedReferenceConfigCache.KeyGenerator. Create cache if not existed yet.
-
get
public <T> T get(ReferenceConfig<T> referenceConfig)
-
destroy
public <T> void destroy(ReferenceConfig<T> referenceConfig)
clear and destroy oneReferenceConfigin the cache.- 参数:
referenceConfig- use for create key.
-
destroyAll
public void destroyAll()
clear and destroy allReferenceConfigin the cache.
-
-