25 |
|
*/ |
26 |
|
public JavaHost( String serverName, int port ){ |
27 |
|
// create a connection to the configurator |
28 |
+ |
System.out.println("Creating connection with Configurtator"); |
29 |
|
Config config = new Config(serverName, port); |
30 |
|
// the config class knows what values it wants to get from |
31 |
|
// the configurator |
32 |
|
|
33 |
|
// create a SystemMonitor object and pass the confifurator |
34 |
|
// as a param so it knows what to do! |
35 |
+ |
System.out.println("Creating System Monitor"); |
36 |
|
SystemMonitor sysMon = new SystemMonitor(config); |
37 |
|
|
38 |
|
while ( true ){ |
39 |
|
// keep going for ever and ever ;) |
40 |
|
// send a udp packet to the filter declared in config |
41 |
|
// send it the xml packet created by getInfo() |
42 |
< |
LowLevelNet.sendUDPPacket(config, sysMon.getInfo()); |
43 |
< |
} |
42 |
> |
System.out.println("Sending UDP Packet"); |
43 |
> |
LowLevelNet.sendUDPPacket(config, sysMon.getInfo()); |
44 |
> |
config.sendHeartBeat(); |
45 |
> |
if ( config.reloadConfig() ){ |
46 |
> |
System.out.println("Resarting System"); |
47 |
> |
break; |
48 |
> |
} |
49 |
> |
} // while |
50 |
|
|
51 |
+ |
|
52 |
|
} // public javahost |
53 |
|
|
54 |
|
|