return getCometSession(httpSession, create, new ConcurrentLinkedQueue<Serializable>());
}
public static CometSession getCometSession(HttpSession httpSession, boolean create, Queue<Serializable> queue) {
synchronized (httpSession) {
CometSessionImpl session = (CometSessionImpl) httpSession.getAttribute(CometSession.HTTP_SESSION_KEY);
if (session == null) {
if (create) {
session = new CometSessionImpl(httpSession, queue, AsyncServlet.initialize(httpSession.getServletContext()));
httpSession.setAttribute(CometSession.HTTP_SESSION_KEY, session);
}
}
return session;
}