// Path: ace-core/src/main/java/wiki/chenxun/ace/core/base/common/AceApplicationConfig.java
// @Data
// @ConfigBean(AceApplicationConfig.PREFIX)
// public class AceApplicationConfig {
// 
// 
//     public static final String PREFIX = "ace.application";
// 
//     private String name;
// 
//     private String dispatch;
// 
//     private String server;
// 
//     private String packages ="wiki.chenxun.ace.core";
// 
//     private String container;
// 
//     private String register;
// 
// }
// 
// Path: ace-core/src/main/java/wiki/chenxun/ace/core/base/common/AceServerConfig.java
// @Data
// @ConfigBean(AceServerConfig.PREFIX)
// public class AceServerConfig {
// 
//     public static final String PREFIX = "ace.server";
// 
//     private long timeout = 1000L;
// 
//     private int port = 8080;
// 
//     private int backSize = 1024;
// }


import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.Stat;
import wiki.chenxun.ace.core.base.annotations.ConfigBean;
import wiki.chenxun.ace.core.base.common.AceApplicationConfig;
import wiki.chenxun.ace.core.base.common.AceServerConfig;
import wiki.chenxun.ace.core.base.register.RegisterConfig;
import wiki.chenxun.ace.core.base.support.InetAddressUtil;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
            configBeanParser = new ConfigBeanParser();
            configBeanParser.parser(cls);
            add(configBeanParser);
        }
        return configBeanParser;

    }

    @Override
    public void add(ConfigBeanParser parser) {
        configInstances.put(parser.getConfigBean().getClass(), parser);
    }

    @Override
    public synchronized void export() {
        if (zooKeeper != null) {
            return;
        }
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                RegisterConfig registerConfig = (RegisterConfig) configInstances.get(RegisterConfig.class).getConfigBean();
                try {
                    zooKeeper = new ZooKeeper(registerConfig.getUrl(), registerConfig.getTimeout(), new Watcher() {
                        @Override
                        public void process(WatchedEvent watchedEvent) {

                        }
                    });
                    String ip = InetAddressUtil.getHostIp();
// Path: ace-core/src/main/java/wiki/chenxun/ace/core/base/common/AceApplicationConfig.java
// @Data
// @ConfigBean(AceApplicationConfig.PREFIX)
// public class AceApplicationConfig {
// 
// 
//     public static final String PREFIX = "ace.application";
// 
//     private String name;
// 
//     private String dispatch;
// 
//     private String server;
// 
//     private String packages ="wiki.chenxun.ace.core";
// 
//     private String container;
// 
//     private String register;
// 
// }
// 
// Path: ace-core/src/main/java/wiki/chenxun/ace/core/base/common/AceServerConfig.java
// @Data
// @ConfigBean(AceServerConfig.PREFIX)
// public class AceServerConfig {
// 
//     public static final String PREFIX = "ace.server";
// 
//     private long timeout = 1000L;
// 
//     private int port = 8080;
// 
//     private int backSize = 1024;
// }


// Path: ace-core/src/main/java/wiki/chenxun/ace/core/base/config/DefaultConfig.java
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.Stat;
import wiki.chenxun.ace.core.base.annotations.ConfigBean;
import wiki.chenxun.ace.core.base.common.AceApplicationConfig;
import wiki.chenxun.ace.core.base.common.AceServerConfig;
import wiki.chenxun.ace.core.base.register.RegisterConfig;
import wiki.chenxun.ace.core.base.support.InetAddressUtil;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

            configBeanParser = new ConfigBeanParser();
            configBeanParser.parser(cls);
            add(configBeanParser);
        }
        return configBeanParser;

    }

    @Override
    public void add(ConfigBeanParser parser) {
        configInstances.put(parser.getConfigBean().getClass(), parser);
    }

    @Override
    public synchronized void export() {
        if (zooKeeper != null) {
            return;
        }
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                RegisterConfig registerConfig = (RegisterConfig) configInstances.get(RegisterConfig.class).getConfigBean();
                try {
                    zooKeeper = new ZooKeeper(registerConfig.getUrl(), registerConfig.getTimeout(), new Watcher() {
                        @Override
                        public void process(WatchedEvent watchedEvent) {

                        }
                    });
                    String ip = InetAddressUtil.getHostIp();
                    AceServerConfig aceServerConfig = (AceServerConfig) configBeanParser(AceServerConfig.class).getConfigBean();