package org.ts.ddcs.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author dylan
 */
@Component
public class Config {
    @Autowired
    public ServerConfig serverConfig;

    private static class ServerConfigInstanceHolder {
        private static Config instance = new Config();
    }

    public static Config newInstance() {
        return Config.ServerConfigInstanceHolder.instance;
    }

    @PostConstruct
    void init(){
        Config.newInstance().serverConfig=serverConfig;
    }
}
