docs: public JcsegServer initFromGlobalConfig(JSONObject globalConfig) 
              throws CloneNotSupportedException, JcsegException
      {
          /*
           * parse and initialize the server according to the global config
          */
          if ( globalConfig.has("server_config") ) {
              JSONObject serverSetting = globalConfig.getJSONObject("server_config");
              if ( serverSetting.has("host") ) {
                  config.setHost(serverSetting.getString("host"));
              }
              if ( serverSetting.has("port") ) {
                  config.setPort(serverSetting.getInt("port"));
              }
              if ( serverSetting.has("charset") ) {
                  config.setCharset(serverSetting.getString("charset")); 
              }
              if ( serverSetting.has("max_thread_pool_size") ) {
                  config.setMaxThreadPoolSize(serverSetting.getInt("max_thread_pool_size"));
              }
              if ( serverSetting.has("thread_idle_timeout") ) {
                  config.setThreadIdleTimeout(serverSetting.getInt("thread_idle_timeout"));
              }
              if ( serverSetting.has("http_output_buffer_size") ) {
                  config.setOutputBufferSize(serverSetting.getInt("http_output_buffer_size"));
              }
              if ( serverSetting.has("http_request_header_size") ) {
                  config.setRequestHeaderSize(serverSetting.getInt("http_request_header_size"));
              }
              if ( serverSetting.has("http_response_header_size") ) {
                  config.setResponseHeaderSize(serverSetting.getInt("http_connection_idle_timeout"));
              }
          }
  
          //create a global JcsegTaskConfig and initialize from the global_setting
          JcsegTaskConfig globalJcsegTaskConfig = new JcsegTaskConfig(false);
          if ( globalConfig.has("jcseg_global_config") ) {
              JSONObject globalSetting = globalConfig.getJSONObject("jcseg_global_config");
              resetJcsegTaskConfig(globalJcsegTaskConfig, globalSetting);
          }
          
          /*
           * create the dictionaries according to the definition of dict 
           * and we will make a copy of the globalSetting for dictionary load
           * 
           * reset the max length to pass the dictionary words length limitation
          */
          JcsegTaskConfig dictLoadConfig = globalJcsegTaskConfig.clone();
          dictLoadConfig.setMaxLength(100);
          if ( globalConfig.has("jcseg_dict") ) {
              JSONObject dictSetting = globalConfig.getJSONObject("jcseg_dict");
              String[] dictNames = JSONObject.getNames(dictSetting);
              for ( String name : dictNames ) {
                  JSONObject dicJson = dictSetting.getJSONObject(name);
                  if ( ! dicJson.has("path") ) {
                      throw new JcsegException("Missing path for dict instance " + name);
                  }
                  
                  String[] lexPath = null;
                  if ( ! dicJson.isNull("path") ) {
                      //process the lexPath
                      JSONArray path = dicJson.getJSONArray("path");
                      List<String> dicPath = new ArrayList<String>();
                      for ( int i = 0; i < path.length(); i++ ) {
                          String filePath = path.get(i).toString();
                          if ( filePath.indexOf("{jar.dir}") > -1 ) {
                              filePath = filePath.replace("{jar.dir}", Util.getJarHome(this));
                          }
                          dicPath.add(filePath);
                      }
                      
                      lexPath = new String[dicPath.size()];
                      dicPath.toArray(lexPath);
                      dicPath.clear(); dicPath = null;
                  }
                  
                  boolean loadpos = dicJson.has("loadpos") 
                          ? dicJson.getBoolean("loadpos") : true;
                  boolean loadpinyin = dicJson.has("loadpinyin") 
                          ? dicJson.getBoolean("loadpinyin") : true;
                  boolean loadsyn = dicJson.has("loadsyn") 
                          ? dicJson.getBoolean("loadsyn") : true;
                  boolean loadentity = dicJson.has("loadentity") 
                          ? dicJson.getBoolean("loadentity") : true;
                  boolean autoload = dicJson.has("autoload") 
                          ? dicJson.getBoolean("autoload") : false;
                  int polltime = dicJson.has("polltime") 
                          ? dicJson.getInt("polltime") : 300;
                          
                  dictLoadConfig.setLoadCJKPinyin(loadpinyin);
                  dictLoadConfig.setLoadCJKPos(loadpos);
                  dictLoadConfig.setLoadCJKSyn(loadsyn);
                  dictLoadConfig.setLoadEntity(loadentity);
                  dictLoadConfig.setAutoload(autoload);
                  dictLoadConfig.setPollTime(polltime);
                  dictLoadConfig.setLexiconPath(lexPath);
                  
                  //create and register the global dictionary resource
                  ADictionary dic = DictionaryFactory.createDefaultDictionary(dictLoadConfig);
                  resourcePool.addDict(name, dic);
              }
          }
          
          dictLoadConfig = null;
          
          /*
           * create the JcsegTaskConfig instance according to the definition config
          */
          if ( globalConfig.has("jcseg_config") ) {
              JSONObject configSetting = globalConfig.getJSONObject("jcseg_config");
              String[] configNames = JSONObject.getNames(configSetting);
              for ( String name : configNames ) {
                  JSONObject configJson = configSetting.getJSONObject(name);
                  
                  //clone the globalJcsegTaskConfig
                  //and do the override working by local defination
                  JcsegTaskConfig config = globalJcsegTaskConfig.clone();
                  if ( configJson.length() > 0 ) {
                      resetJcsegTaskConfig(config, configJson);
                  }
                  
                  //register the global resource
                  resourcePool.addConfig(name, config);
              }
          }
          
          /*
           * create the tokenizer instance according the definition of tokenizer
          */
          if ( globalConfig.has("jcseg_tokenizer") ) {
              JSONObject tokenizerSetting = globalConfig.getJSONObject("jcseg_tokenizer");
              String[] tokenizerNames = JSONObject.getNames(tokenizerSetting);
              for ( String name : tokenizerNames ) {
                  JSONObject tokenizerJson = tokenizerSetting.getJSONObject(name);
                  
                  int algorithm = tokenizerJson.has("algorithm") 
                          ? tokenizerJson.getInt("algorithm") : JcsegTaskConfig.COMPLEX_MODE;
                  
                  if ( ! tokenizerJson.has("dict") ) {
                      throw new JcsegException("Missing dict setting for tokenizer " + name);
                  }
                  if ( ! tokenizerJson.has("config") ) {
                      throw new JcsegException("Missing config setting for tokenizer " + name);
                  }
                  
                  ADictionary dic = resourcePool.getDict(tokenizerJson.getString("dict"));
                  JcsegTaskConfig config = resourcePool.getConfig(tokenizerJson.getString("config"));
                  if ( dic == null ) {
                      throw new JcsegException("Unknow dict instance " 
                          + tokenizerJson.getString("dict") + " for tokenizer " + name);
                  }
                  
                  if ( config == null ) {
                      throw new JcsegException("Unknow config instance " 
                          + tokenizerJson.getString("config") + " for tokenizer " + name);
                  }
                  
                  resourcePool.addTokenizerEntry(name, new JcsegTokenizerEntry(algorithm, config, dic));
              }
          }
          
          //now, initialize the server
          init();
          
          return this;
      }