1 |
< |
/* Java Host for i-scream |
2 |
< |
* Written by Ash Beeson ab11 |
3 |
< |
* Version History: |
4 |
< |
* 1.0 12/11/00 Inital working version |
5 |
< |
*/ |
1 |
> |
//---PACKAGE DECLARATION--- |
2 |
|
|
3 |
+ |
//---IMPORTS--- |
4 |
+ |
|
5 |
+ |
/** |
6 |
+ |
* A small efficient JavaHost |
7 |
+ |
* Designed to be used as a working design to build the C++ hosts on. |
8 |
+ |
* Hopefully fully functional and thus can be used as part of a test rig. |
9 |
+ |
* |
10 |
+ |
* @author $Author$ |
11 |
+ |
* @version $Id$ |
12 |
+ |
*/ |
13 |
|
class JavaHost { |
14 |
< |
|
15 |
< |
public JavaHost( String serverName, int port ){ |
16 |
< |
// create a connection to the configurator |
17 |
< |
Config config = new Config(serverName, port); |
18 |
< |
// the config class knows what values it wants to get from |
19 |
< |
// the configurator |
20 |
< |
|
21 |
< |
// create a SystemMonitor object and pass the confifurator |
22 |
< |
// as a param so it knows what to do! |
23 |
< |
SystemMonitor sysMon = new SystemMonitor(config); |
24 |
< |
|
25 |
< |
while ( true ){ |
26 |
< |
// keep going for ever and ever ;) |
27 |
< |
// send a udp packet to the filter declared in config |
28 |
< |
// send it the xml packet created by getInfo() |
29 |
< |
LowLevelNet.sendUDPPacket(config, sysMon.getInfo()); |
30 |
< |
} |
31 |
< |
|
32 |
< |
} // public javahost |
33 |
< |
|
14 |
> |
|
15 |
> |
//---FINAL ATTRIBUTES--- |
16 |
> |
|
17 |
> |
//---STATIC METHODS--- |
18 |
> |
|
19 |
> |
//---CONSTRUCTORS--- |
20 |
> |
|
21 |
> |
/** |
22 |
> |
* Constructor for the class. Takes in the hostname and port number |
23 |
> |
* of the Configuration Manager. |
24 |
> |
* |
25 |
> |
*/ |
26 |
> |
public JavaHost( String serverName, int port ){ |
27 |
> |
// create a connection to the configurator |
28 |
> |
Config config = new Config(serverName, port); |
29 |
> |
// the config class knows what values it wants to get from |
30 |
> |
// the configurator |
31 |
> |
|
32 |
> |
// create a SystemMonitor object and pass the confifurator |
33 |
> |
// as a param so it knows what to do! |
34 |
> |
SystemMonitor sysMon = new SystemMonitor(config); |
35 |
> |
|
36 |
> |
while ( true ){ |
37 |
> |
// keep going for ever and ever ;) |
38 |
> |
// send a udp packet to the filter declared in config |
39 |
> |
// send it the xml packet created by getInfo() |
40 |
> |
LowLevelNet.sendUDPPacket(config, sysMon.getInfo()); |
41 |
> |
} |
42 |
> |
|
43 |
> |
} // public javahost |
44 |
> |
|
45 |
> |
|
46 |
> |
//---PUBLIC METHODS--- |
47 |
> |
|
48 |
> |
//---PRIVATE METHODS--- |
49 |
> |
|
50 |
> |
//---ACCESSOR/MUTATOR METHODS--- |
51 |
> |
|
52 |
> |
//---ATTRIBUTES--- |
53 |
> |
|
54 |
> |
//---STATIC ATTRIBUTES--- |
55 |
> |
|
56 |
|
} // class |