private EndOfStream endOfStream;
private Map<Connection<?>, ConnectionEstablished> queued = new LinkedHashMap<Connection<?>, ConnectionEstablished>();
void onStatefulMessage(InterHubMessage message) {
if (message instanceof ConnectionEstablished) {
ConnectionEstablished connectionEstablished = (ConnectionEstablished) message;
queued.put(connectionEstablished.getConnection(), connectionEstablished);
} else if (message instanceof ConnectionClosed) {
ConnectionClosed connectionClosed = (ConnectionClosed) message;
queued.remove(connectionClosed.getConnection());
} else if (message instanceof EndOfStream) {
queued.clear();