for(ConnectionManager connMgr :ProxyRuntimeContext.getInstance().getConnectionManagerList().values()){
registerReporter(connMgr);
}4 启动每一个注入的服务
[java]
Map
context.putAll(ProxyRuntimeContext.getInstance().getConnectionManagerList());
List
//初始化注入的每一个服务,并启动
//amoeba在启动时会启动监控服务和接收服务。用于mysql代理的需要与amoeba_mysql一起使用,因为注入的将会是amoeba_mysql中的服务器
for(BeanObjectEntityConfig serverConfig : serviceConfigList){
Service service = (Service)serverConfig.createBeanObject(false,context);
service.init();
service.start();
//将每一个服务添加到支持优先级处理的释放钩子中
PriorityShutdownHook.addShutdowner(service);
registerReporter(service);
}
Map
context.putAll(ProxyRuntimeContext.getInstance().getConnectionManagerList());
List
//初始化注入的每一个服务,并启动
//amoeba在启动时会启动监控服务和接收服务。用于mysql代理的需要与amoeba_mysql一起使用,因为注入的将会是amoeba_mysql中的服务器
for(BeanObjectEntityConfig serverConfig : serviceConfigList){
Service service = (Service)serverConfig.createBeanObject(false,context);
service.init();
service.start();
//将每一个服务添加到支持优先级处理的释放钩子中
PriorityShutdownHook.addShutdowner(service);
registerReporter(service);
}5 最后是开启report监控线程,一分钟执行一次,如果对这块要求不高,可以将时长修改长一点,如10分钟。