/** * Registers managed beans for all WAN publishers, if any. * * @param wanReplicationService the WAN replication service */ private void registerWanPublisherMBeans(WanReplicationService wanReplicationService) { final Map<String, LocalWanStats> wanStats = wanReplicationService.getStats(); if (wanStats == null) { return; } for (Entry<String, LocalWanStats> replicationStatsEntry : wanStats.entrySet()) { final String wanReplicationName = replicationStatsEntry.getKey(); final LocalWanStats localWanStats = replicationStatsEntry.getValue(); final Map<String, LocalWanPublisherStats> publisherStats = localWanStats.getLocalWanPublisherStats(); for (String targetGroupName : publisherStats.keySet()) { register(new WanPublisherMBean(wanReplicationService, wanReplicationName, targetGroupName, service)); } } }
stats.fromJson(next.getValue().asObject()); wanStats.put(next.getName(), stats);
stats.fromJson(next.getValue().asObject()); wanStats.put(next.getName(), stats);
/** * Registers managed beans for all WAN publishers, if any. * * @param wanReplicationService the WAN replication service */ private void registerWanPublisherMBeans(WanReplicationService wanReplicationService) { final Map<String, LocalWanStats> wanStats = wanReplicationService.getStats(); if (wanStats == null) { return; } for (Entry<String, LocalWanStats> replicationStatsEntry : wanStats.entrySet()) { final String wanReplicationName = replicationStatsEntry.getKey(); final LocalWanStats localWanStats = replicationStatsEntry.getValue(); final Map<String, LocalWanPublisherStats> publisherStats = localWanStats.getLocalWanPublisherStats(); for (String targetGroupName : publisherStats.keySet()) { register(new WanPublisherMBean(wanReplicationService, wanReplicationName, targetGroupName, service)); } } }
@ManagedAnnotation("state") @ManagedDescription("State of the WAN replication publisher") public String getState() { final Map<String, LocalWanStats> wanStats = managedObject.getStats(); if (wanStats == null) { return ""; } final LocalWanStats wanReplicationStats = wanStats.get(wanReplicationName); final Map<String, LocalWanPublisherStats> wanDelegatingPublisherStats = wanReplicationStats.getLocalWanPublisherStats(); final LocalWanPublisherStats wanPublisherStats = wanDelegatingPublisherStats.get(targetGroupName); return wanPublisherStats.getPublisherState().name(); }
@ManagedAnnotation("state") @ManagedDescription("State of the WAN replication publisher") public String getState() { final Map<String, LocalWanStats> wanStats = managedObject.getStats(); if (wanStats == null) { return ""; } final LocalWanStats wanReplicationStats = wanStats.get(wanReplicationName); final Map<String, LocalWanPublisherStats> wanDelegatingPublisherStats = wanReplicationStats.getLocalWanPublisherStats(); final LocalWanPublisherStats wanPublisherStats = wanDelegatingPublisherStats.get(targetGroupName); return wanPublisherStats.getPublisherState().name(); }