Thanks also to James Raitsev that has a version with very excellent comments at HostServer.java Raitsev though this code may not work with all browsers.
You will be graded on the explanatory comments you add.
In the larger assignment, the agent would migrate autonomously, and the client will not know where it has gone. Thus we must leave behind a zombie, to point to the new location when the client connects, or must maintain a NameServer that clients connect to, which then contacts the agent at its currently location, or ...[fill in your own solution].
Nameserver link, for fun. Keeps track of the current location, and group, of each full Distributed Intelligent Agent.