Author: alexsmirnov
Date: 2010-11-05 17:49:56 -0400 (Fri, 05 Nov 2010)
New Revision: 19976
Modified:
trunk/core/impl/src/main/java/org/richfaces/application/push/impl/SessionManagerImpl.java
trunk/core/impl/src/main/java/org/richfaces/application/push/impl/SessionQueue.java
Log:
CODING IN PROGRESS - issue RF-9157: Push: pre-promotion code review
https://jira.jboss.org/browse/RF-9157
Modified:
trunk/core/impl/src/main/java/org/richfaces/application/push/impl/SessionManagerImpl.java
===================================================================
---
trunk/core/impl/src/main/java/org/richfaces/application/push/impl/SessionManagerImpl.java 2010-11-05
20:16:25 UTC (rev 19975)
+++
trunk/core/impl/src/main/java/org/richfaces/application/push/impl/SessionManagerImpl.java 2010-11-05
21:49:56 UTC (rev 19976)
@@ -68,6 +68,7 @@
}
public void removePushSession(Session session) {
+ // TODO - possible null pointer exception
sessionMap.remove(session.getId());
if (session != null) {
sessionQueue.remove(session);
@@ -76,6 +77,7 @@
public void destroy() {
//TODO notify all session
+ // TODO - synchronize clear/remove/clear. Other thread can insert new value
during destroy.
sessionQueue.clear();
while (!sessionMap.isEmpty()) {
Modified:
trunk/core/impl/src/main/java/org/richfaces/application/push/impl/SessionQueue.java
===================================================================
---
trunk/core/impl/src/main/java/org/richfaces/application/push/impl/SessionQueue.java 2010-11-05
20:16:25 UTC (rev 19975)
+++
trunk/core/impl/src/main/java/org/richfaces/application/push/impl/SessionQueue.java 2010-11-05
21:49:56 UTC (rev 19976)
@@ -36,6 +36,7 @@
*
*/
//TODO - optimize algorithm
+// TODO - use BlockingQueue ?
final class SessionQueue {
private static final Comparator<? super Session> SESSIONS_COMPARATOR = new
Comparator<Session>() {