synchronized public Set<ClientObject> getClients() {
return userList.keySet();
}
synchronized public void clear() {
Closeable chat;
for (ClientObject userObj : getClients()) {
chat = getChatBy(userObj);
if (chat != null) { // if previously wasn't closed from client side, for example
chat.close();
}
}
userList.clear();
}