// 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;
package wiki.chenxun.ace.core.base.config;




/**
 * @Description: Created by chenxun on 2017/4/16.
 */
public enum DefaultConfig implements Config {

    INSTANCE;

    /**
     * 配置类解析实例
     */
    private Map<Class, ConfigBeanParser> configInstances = new ConcurrentHashMap<>();

    private volatile ZooKeeper zooKeeper;



    @Override
    public ConfigBeanParser configBeanParser(Class cls) {
        ConfigBeanParser configBeanParser = configInstances.get(cls);
        if (configBeanParser == null) {
            configBeanParser = new ConfigBeanParser();
// 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;

package wiki.chenxun.ace.core.base.config;




/**
 * @Description: Created by chenxun on 2017/4/16.
 */
public enum DefaultConfig implements Config {

    INSTANCE;

    /**
     * 配置类解析实例
     */
    private Map<Class, ConfigBeanParser> configInstances = new ConcurrentHashMap<>();

    private volatile ZooKeeper zooKeeper;



    @Override
    public ConfigBeanParser configBeanParser(Class cls) {
        ConfigBeanParser configBeanParser = configInstances.get(cls);
        if (configBeanParser == null) {
            configBeanParser = new ConfigBeanParser();
            configBeanParser.parser(cls);