FileDocCategorySizeDatePackage
RunServerImpl.javaAPI DocExample858Sun Jun 22 18:58:24 BST 2003servers

RunServerImpl

public class RunServerImpl extends UnicastRemoteObject implements RunServer
This is the main class of the server

Fields Summary
List
list
The list of Agents we've received
Constructors Summary
public RunServerImpl()

		list = new ArrayList();
	
Methods Summary
public java.rmi.server.RemoteStubconnect(AgentImpl da)
The remote method that "does all the work". This won't get called until the client starts up.

		System.out.print("Adding client " + da);
		try {
			System.out.print(" from ");
			System.out.print(getClientHost());
		} catch (Exception ex) {
			// nothing
		}
		System.out.println();
		list.add(da);

		// exportObject() returns the Stub; we return it to the client.
		return UnicastRemoteObject.exportObject(da);