espandy / memcache-client-forjava

Automatically exported from code.google.com/p/memcache-client-forjava
0 stars 0 forks source link

在main方法里执行进程不会正常停止 #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
replay this bug:

在myeclipse里写段最简单的test代码,程序无法正常结束。会有2
个进程始终在running.

public static void main(String[] args) {
ICacheManager<IMemcachedCache> manager = 
CacheUtil.getCacheManager(IMemcachedCache.class, 
MemcachedCacheManager.class.getName());
    manager.setConfigFile("memcached1.xml");// 可以指定配置文件名
    manager.start();
    try {
     IMemcachedCache cache = manager.getCache("mclient0");
     cache.put("liuqijun", "liuqijuun123");
     System.out.println(cache.get("liuqijun"));
} catch (Exception e) {
e.printStackTrace();
}finally{
manager.stop();
System.out.println("stop");
}
}

配置文件里只配置一个socketpool和一个client.

Original issue reported on code.google.com by BM888...@gmail.com on 28 Oct 2010 at 2:16