Examining an HSP's State

A JANET client can examine an hosting service provider's state programmatically. This section of the tutorial illustrates this. The element's of an HSP that are exposed to the client include:
  • The number of hosts available at the time the state was obtained.
  • The number of task servers available at the time the state was obtained.
  • The client queue.
These members of an HspState object can be accessed via the following respective methods:
  • int numHosts()
  • int numTaskServers()
  • Qu getClientQ()
Please see the JANET Javadoc regarding the HspState class.

The client application, Application.java, illustrates their use. The output.

N.B. Task servers update the hosting service provider with their number of available hosts every 30 seconds. Therefore, the number of hosts from the HSP's point of view may not reflect the actual number of hosts.