类 ReferenceConfigCache
- java.lang.Object
-
- org.apache.dubbo.config.utils.ReferenceConfigCache
-
public class ReferenceConfigCache extends Object
A simple util class for cacheReferenceConfigBase.ReferenceConfigBaseis a heavy Object, it's necessary to cache these object for the framework which createReferenceConfigBasefrequently.You can implement and use your own
ReferenceConfigBasecache if you need use complicate strategy.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interfaceReferenceConfigCache.KeyGenerator
-
字段概要
字段 修饰符和类型 字段 说明 static ReferenceConfigCache.KeyGeneratorDEFAULT_KEY_GENERATORCreate the key with the Group, Interface and version attribute ofReferenceConfigBase.static StringDEFAULT_NAME
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddestroy(Class<?> type)voiddestroy(String key, Class<?> type)<T> voiddestroy(org.apache.dubbo.config.ReferenceConfigBase<T> referenceConfig)clear and destroy oneReferenceConfigBasein the cache.voiddestroyAll()clear and destroy allReferenceConfigBasein the cache.<T> Tget(Class<T> type)<T> Tget(String key)<T> Tget(String key, Class<T> type)Fetch cache with the specified key.<T> Tget(org.apache.dubbo.config.ReferenceConfigBase<T> referenceConfig)<T> List<T>getAll(Class<T> type)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.ConcurrentMap<Class<?>,ConcurrentMap<String,Object>>getProxies()ConcurrentMap<String,org.apache.dubbo.config.ReferenceConfigBase<?>>getReferredReferences()StringtoString()
-
-
-
字段详细资料
-
DEFAULT_KEY_GENERATOR
public static final ReferenceConfigCache.KeyGenerator DEFAULT_KEY_GENERATOR
Create the key with the Group, Interface and version attribute ofReferenceConfigBase.key example:
group1/org.apache.dubbo.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(org.apache.dubbo.config.ReferenceConfigBase<T> referenceConfig)
-
get
public <T> T get(String key, Class<T> type)
Fetch cache with the specified key. The key is decided by KeyGenerator passed-in. If the default KeyGenerator is used, then the key is in the format ofgroup/interfaceClass:version- 类型参数:
T- object type- 参数:
key- cache keytype- object class- 返回:
- object from the cached ReferenceConfigBase
- 另请参阅:
ReferenceConfigCache.KeyGenerator.generateKey(ReferenceConfigBase)
-
get
public <T> T get(String key)
-
get
public <T> T get(Class<T> type)
-
destroy
public void destroy(Class<?> type)
-
destroy
public <T> void destroy(org.apache.dubbo.config.ReferenceConfigBase<T> referenceConfig)
clear and destroy oneReferenceConfigBasein the cache.- 参数:
referenceConfig- use for create key.
-
destroyAll
public void destroyAll()
clear and destroy allReferenceConfigBasein the cache.
-
getReferredReferences
public ConcurrentMap<String,org.apache.dubbo.config.ReferenceConfigBase<?>> getReferredReferences()
-
getProxies
public ConcurrentMap<Class<?>,ConcurrentMap<String,Object>> getProxies()
-
-