private CopyOnWriteArrayList<WebsocketBindingCallback> clients = new CopyOnWriteArrayList<WebsocketBindingCallback>();
@Override
public void postMessage(String user, String message) {
for (WebsocketBindingCallback callback : new ArrayList<WebsocketBindingCallback>(clients)) {
WebsocketStatus status = callback.sendMessage(user + ": " + message);
if (status == WebsocketStatus.CLOSED) {
clients.remove(callback);
}
}
}