类 ReferenceConfigCache
- java.lang.Object
-
- com.alibaba.dubbo.config.utils.ReferenceConfigCache
-
public class ReferenceConfigCache extends Object
a simple util class for cacheReferenceConfig
.ReferenceConfig
is a heavy Object, it's necessary to cache these object for the framework which createReferenceConfig
frequently.You can implement and use your own
ReferenceConfig
cache if you need use complicate strategy.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interface
ReferenceConfigCache.KeyGenerator
-
字段概要
字段 修饰符和类型 字段 说明 static ReferenceConfigCache.KeyGenerator
DEFAULT_KEY_GENERATOR
Create the key with the Group, Interface and version attribute ofReferenceConfig
.static String
DEFAULT_NAME
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 <T> void
destroy(ReferenceConfig<T> referenceConfig)
clear and destroy oneReferenceConfig
in the cache.void
destroyAll()
clear and destroy allReferenceConfig
in the cache.<T> T
get(ReferenceConfig<T> referenceConfig)
static ReferenceConfigCache
getCache()
Get the cache use default name andDEFAULT_KEY_GENERATOR
to generate cache key.static ReferenceConfigCache
getCache(String name)
Get the cache use specified name andReferenceConfigCache.KeyGenerator
.static ReferenceConfigCache
getCache(String name, ReferenceConfigCache.KeyGenerator keyGenerator)
Get the cache use specifiedReferenceConfigCache.KeyGenerator
.String
toString()
-
-
-
字段详细资料
-
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_GENERATOR
to 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 oneReferenceConfig
in the cache.- 参数:
referenceConfig
- use for create key.
-
destroyAll
public void destroyAll()
clear and destroy allReferenceConfig
in the cache.
-
-