Esempio n. 1
0
 /**
  * Add MBean monitors on the given monitorTargets.
  *
  * @param monitorTargets a set of monitor targets
  * @param reportPath report path
  */
 public void add(Set<AgentInfo> monitorTargets, File reportPath) {
   for (AgentInfo target : monitorTargets) {
     String targetKey = createTargetKey(target);
     if (!monitorClientsMap.containsKey(targetKey)) {
       MonitorClientSerivce bean = applicationContext.getBean(MonitorClientSerivce.class);
       bean.init(
           target.getIp(), target.getPort(), reportPath, cacheManager.getCache("monitor_data"));
       monitorClientsMap.put(targetKey, bean);
     }
   }
 }
Esempio n. 2
0
 private String createTargetKey(AgentInfo target) {
   return target.getIp();
 }