Remote server = (Account) _namesToServers.get(accountName);
if (null == server) {
return;
}
Integer support = (Integer) _serversToSupport.get(server);
if (null == support) {
System.out.println("Attempt to unexport non-supported account");
return;
}
int newSupportValue = support.intValue() - 1;
if (newSupportValue > 0) {
_serversToSupport.put(server, new Integer(newSupportValue));
return;
}
try {
UnicastRemoteObject.unexportObject(server, true);
_serversToSupport.remove(server);
System.out.println("Server " + accountName + " successfully unexported.");
} catch (Exception e) {
System.out.println(e);
}