use of com.alibaba.dubbo.cache.support.threadlocal.ThreadLocalCache in project dubbo by alibaba.
the class CacheTest method testCacheProvider.
@Test
public void testCacheProvider() throws Exception {
CacheFactory cacheFactory = ExtensionLoader.getExtensionLoader(CacheFactory.class).getAdaptiveExtension();
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("findCache.cache", "threadlocal");
URL url = new URL("dubbo", "127.0.0.1", 29582, "com.alibaba.dubbo.config.cache.CacheService", parameters);
Invocation invocation = new RpcInvocation("findCache", new Class[] { String.class }, new String[] { "0" }, null, null);
Cache cache = cacheFactory.getCache(url, invocation);
assertTrue(cache instanceof ThreadLocalCache);
}
Aggregations