@@ -0,0 +1,1386 @@
+package org.lionsoul.jcseg.server;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.lionsoul.jcseg.tokenizer.core.ADictionary;%0Aimport org.lionsoul.jcseg.tokenizer.core.JcsegTaskConfig;%0A%0A/**%0A * global resource pool that manager the%0A * dictionray, configuration, ISegment instance of jcseg.%0A * %0A * @author chenxin%3Cchenxin619315@gmail.com%3E%0A*/%0Apublic class GlobalResourcePool %0A%7B%0A%09/**%0A%09 * dictionary pool %0A%09*/%0A%09private Map%3CString, ADictionary%3E dicPool = null;%0A%09%0A%09/**%0A%09 * JcsegTaskConfig pool %0A%09*/%0A%09private Map%3CString, JcsegTaskConfig%3E configPool = null;%0A%09%0A%09%0A%09/**%0A%09 * construct method %0A%09*/%0A%09public GlobalResourcePool()%0A%09%7B%0A%09%09dicPool = new HashMap%3CString, ADictionary%3E();%0A%09%09configPool = new HashMap%3CString, JcsegTaskConfig%3E();%0A%09%7D%0A%09%0A%09/**%0A%09 * add a new Dictionary instance mapping%0A%09 * %0A%09 * @param%09name%0A%09 * @param%09dic%0A%09*/%0A%09public void addDict(String name, ADictionary dic)%0A%09%7B%0A%09%09dicPool.put(name, dic);%0A%09%7D%0A%09%0A%09/**%0A%09 * remove specifield dictionary mapping%0A%09 * %0A%09 * @param%09name%0A%09*/%0A%09public void removeDict(String name)%0A%09%7B%0A%09%09dicPool.remove(name);%0A%09%7D%0A%09%0A%09/**%0A%09 * add a new JcsegTaskConfig mapping%0A%09 * %0A%09 * @param%09name%0A%09 * @param%09config%0A%09*/%0A%09public void addConfig(String name, JcsegTaskConfig config)%0A%09%7B%0A%09%09configPool.put(name, config);%0A%09%7D%0A%09%0A%09/**%0A%09 * remove a specifield JcsegTaskConfig mapping%0A%09 * %0A%09 * @param%09name%0A%09*/%0A%09public void removeConfig(String name)%0A%09%7B%0A%09%09configPool.remove(name);%0A%09%7D%0A%7D%0A

add GlobalResourcePool