@SuppressWarnings("unchecked")
	public void configFromJSONFile(String fileName) throws IOException, JSONException, ClassNotFoundException{
    	File file=new File(fileName);
    	FileInputStream fileStream=new FileInputStream(file);
    	BufferedReader reader=new BufferedReader(new InputStreamReader(fileStream));
    	StringBuilder sb=new StringBuilder();
    	String line=null;
    	while((line=reader.readLine())!=null){
    		sb.append(line);
    		sb.append("\n");
    	}
    	JSONObject configJson=new JSONObject(sb.toString());
    	JSONArray moduleArray=configJson.getJSONArray("modules");

    	//load class
    	ClassLoader classLoader=ClassLoader.getSystemClassLoader();
    	for(int i=0,length=moduleArray.length();i<length;i++){
    		String moduleName=moduleArray.getString(i);
    		Class<? extends IModule> clazz;
    		clazz=(Class<? extends IModule>) classLoader.loadClass(moduleName);
    		classSet.add(clazz);
    	}

    	//add config for each module into context
    	for(Class<? extends IModule> clazz:classSet){
    		JSONObject moduleConfig;
    		try{
    			moduleConfig=configJson.getJSONObject(clazz.getCanonicalName());
    		}catch(JSONException e){
    			continue;
    		}
    		Iterator<?> iter=moduleConfig.keys();
    		while(iter.hasNext()){
    			String key=(String) iter.next();
    			String value=moduleConfig.getString(key);
    			this.moduleContext.addConfigParam(clazz, key, value);
    		}
    	}

    	reader.close();
    }