Java Reference
In-Depth Information
* is desired
* @return a set of {@link Player} objects that
* make up the roster of the team, or {@code null}
* if there is a problem contacting the server
*/
public Set<Player> getPlayers(String fromHost, String team) {
try {
StatRecorder recorder = getRecorder(fromHost);
if (recorder != null) {
return recorder.getRoster(team);
} else {
return null;
}
} catch (RemoteException e) {
System.out.println("Unable to find roster for team " + team);
e.printStackTrace();
return null;
}
}
/**
* Send the results of a game to a {@link StatRecorder}
* running on the indicated host. If there is a problem
* contacting the host, print an error message on the
* console.
* @param toHost name of the host on which the server
* is running
* @param score the {@link BoxScore} for the game
* being reported
*/
public void reportGame(String toHost, BoxScore score) {
try {
StatRecorder recorder = getRecorder(toHost);
if (recorder != null) {
recorder.recordGame(score);
}
} catch (Exception e) {
System.out.println("Unable to report game");
e.printStackTrace();
}
}
/**
* A private method that does the work of getting
* a {@link Remote} reference to the {@link StatRecorder}.
* If there is a problem with the communication, or if
Search WWH ::




Custom Search