public ExternalRemoteServerContext login(String username, String password)
throws RemoteException, LoginException {
System.setSecurityManager(null);
Registry registry = LocateRegistry.getRegistry(server, port);
try {
cspokerServer = (ExternalRemoteCSPokerServer) registry.lookup("CSPokerServer");
} catch (NotBoundException exception) {
throw new RemoteException("CSPokerServer not found in registry.", exception);
}
ExternalRemoteServerContext context = cspokerServer.login(username, password);
return new ServerContextStub(context);