1 package org.csc.phynixx.watchdog.jmx;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import org.csc.phynixx.watchdog.WatchdogInfo;
25 import org.csc.phynixx.watchdog.WatchdogRegistry;
26
27 public class WatchTheWatchdogs implements WatchTheWatchdogsMBean {
28
29 public String getState() {
30 return WatchdogRegistry.getTheRegistry().getManagementWatchdogsState();
31 }
32
33 public String[][] showWatchdogInfos() throws Exception {
34 WatchdogInfo[] infos = WatchdogRegistry.getTheRegistry().getManagementWatchdogsInfo();
35
36 String[][] wds = new String[infos.length][];
37 for (int j = 0; j < infos.length; j++) {
38 wds[j] = infos[j].getWatchdogInfos();
39 }
40 return wds;
41 }
42
43
44 public void restart() throws Exception {
45 WatchdogRegistry.getTheRegistry().restart();
46 }
47
48 }