public static void main(String[] args) throws Exception
    {
		logger.setLevel(Level.WARNING);
        if (args.length < 3 || !args[1].equals("-c")) {
            System.err.println("Usage: WebServer -c <jmmix json configuration file>");
            logger.log(Level.SEVERE, "Usage: WebServer -c <jmmix json configuration file>");
            System.exit(1);
        }

        JSONParser parser = new JSONParser();

        JSONObject config = (JSONObject)parser.parse(new FileReader(args[2]));

        int port = (int)(long)(Long)config.get("port");
        String target = null;
        if (config.containsKey("target")) {
            target = (String)config.get("target");
        }
        List<String> whitelist = new LinkedList<String>();
        if (config.containsKey("bean_whitelist")) {
            JSONArray beanRegexs = (JSONArray) config.get("bean_whitelist");
            for(Object beanRegex : beanRegexs) {
                whitelist.add((String)beanRegex);
            }
        }
        List<String> blacklist = new LinkedList<String>();
        if (config.containsKey("bean_blacklist")) {
            JSONArray beanRegexs = (JSONArray) config.get("bean_blacklist");
            for(Object beanRegex : beanRegexs) {
                blacklist.add((String)beanRegex);
            }
        }

        Server server = new Server(port);
        server.setHandler(new MetricsHandler(target, whitelist, blacklist));
        server.start();
        server.join();
    }