if (queue != null) {
synchronized (activeEvents) {
Set<HttpServletResponse> responses = activeEvents.get(session);
if (!post && queue.messagesWaiting()) {
context.notify(getMessages(response, queue), CometEvent.NOTIFY, handler);
}
if (!queueToSession.containsKey(queue))
queueToSession.put(queue, session);