FileDocCategorySizeDatePackage
ClientProgram.javaAPI DocExample1442Fri Apr 20 21:16:34 BST 2001com.darwinsys.client

ClientProgram

public class ClientProgram extends UnicastRemoteObject implements Client
This class tries to be all things to all people: - main program for client to run. - "server" program for remote to use Client of

Fields Summary
protected static final String
host
Constructors Summary
public ClientProgram()
No-argument constructor required as we are a Remote Object


	          
	    
	
Methods Summary
public voidalert(java.lang.String message)
This is the client callback

		System.out.println(message);
	
private voiddo_the_work()
This is the server program part


		System.out.println("Client starting");

		// First, register us with the RMI registry
		// Naming.rebind("Client", this);
	
		// Now, find the server, and register with it
		System.out.println("Finding server");
		TickerServer server = 
			(TickerServer)Naming.lookup("rmi://" + host + "/" +
			TickerServer.LOOKUP_NAME);

		// This should cause the server to call us back.
		System.out.println("Connecting to server");
		server.connect(this);

		System.out.println("Client program ready.");
	
public static voidmain(java.lang.String[] argv)
This is the main program, just to get things started.

		new ClientProgram().do_the_work();