Examining an HSP's State

A JICOS client can examine a hosting service provider's state programmatically using the Client2Hsp getState method:
HspState getState()
This section of the tutorial illustrates this. The elements of a hosting service provider that are exposed to the client include:
  • The HSP's ServiceName
  • 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:
  • ServiceName getHspServiceName()
  • int numHosts()
  • int numTaskServers()
  • Qu getClientQ()
Please see the JICOS Javadoc regarding the HspState class.

The client application, Application.java, illustrates their use. The output indicates the contents of an HspState object as it changes over time.

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.