diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometSessionManager.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometSessionManager.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometSessionManager.java b/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometSessionManager.java new file mode 100644 index 0000000000..a34a3615d5 --- /dev/null +++ b/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometSessionManager.java @@ -0,0 +1,30 @@ +package org.apache.tuscany.sca.binding.comet.runtime.manager; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import org.atmosphere.cpr.Broadcaster; + +public class CometSessionManager { + + private static final ConcurrentMap<String, Broadcaster> broadcasters = new ConcurrentHashMap<String, Broadcaster>(); + + private CometSessionManager() { + } + + public static void add(String sessionId, Broadcaster broadcaster) { + broadcasters.put(sessionId, broadcaster); + } + + public static Broadcaster get(String sessionId) { + return broadcasters.get(sessionId); + } + + public static void remove(String sessionId) { + broadcasters.remove(sessionId); + } + + public static void clear() { + broadcasters.clear(); + } +} |