added skeleton ChatClient class

git-svn-id: svn://anubis/gvsu@140 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
josh 2008-09-14 19:00:10 +00:00
parent 4642c73779
commit b500ee6c5d
2 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,29 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.math.BigDecimal;
public class ChatClient
{
public static void main(String args[])
{
if (System.getSecurityManager() == null)
{
System.setSecurityManager(new SecurityManager());
}
try
{
Registry registry = LocateRegistry.getRegistry(args[0]);
PresenceService pserv = (PresenceService)
registry.lookup("PresenceService");
Pi task = new Pi(Integer.parseInt(args[1]));
BigDecimal pi = comp.executeTask(task);
System.out.println(pi);
}
catch (Exception e)
{
System.err.println("ChatClient exception:");
e.printStackTrace();
}
}
}

View File

@ -46,8 +46,8 @@ public class PresenceServiceImpl implements PresenceService
PresenceService stub = (PresenceService)
UnicastRemoteObject.exportObject(impl, 0);
Registry registry = LocateRegistry.getRegistry();
registry.rebind("PresenceServiceImpl", stub);
System.out.println("PresenceServiceImpl bound");
registry.rebind("PresenceService", stub);
System.out.println("PresenceService bound");
}
catch (Exception e)
{