//spring初始化bean的时候,如果bean实现了InitializingBean接口,会自动调用afterPropertiesSet方法
@Repository
public class SystemConfigData implements InitializingBean{
Logger logger = Logger.getLogger(this.getClass());
public static String[] MEM_SERVERS;
@Override
public void afterPropertiesSet() throws Exception
{
try
{
Properties prop = new Properties();
InputStream in = this.getClass().getResourceAsStream("/authconfig/authconfig.properties");
prop.load(in);
String memServersObj = prop.getProperty("mem_servers");
}
catch (Exception e)
{
logger.error(e, e);
}
}
}