From 2e0a5f4c1368993c8cf71b9f4b59273a323b9aff Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 28 Jul 2011 11:07:25 +0000 Subject: Recreate 2.0-Beta3 branch from current trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1151792 13f79535-47bb-0310-9956-ffa450edef68 --- .../runtime/manager/CometEndpointManager.java | 51 ++++++++++++++++++++++ .../runtime/manager/CometOperationManager.java | 51 ++++++++++++++++++++++ .../comet/runtime/manager/CometSessionManager.java | 51 ++++++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometEndpointManager.java create mode 100644 sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometOperationManager.java create mode 100644 sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometSessionManager.java (limited to 'sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager') diff --git a/sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometEndpointManager.java b/sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometEndpointManager.java new file mode 100644 index 0000000000..3d9707ca8e --- /dev/null +++ b/sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometEndpointManager.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.binding.comet.runtime.manager; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import org.apache.tuscany.sca.runtime.RuntimeEndpoint; + +/** + * Manager for Tuscany comet endpoints. This is a thread-safe singleton class. + */ +public class CometEndpointManager { + + private static final ConcurrentMap endpoints = new ConcurrentHashMap(); + + private CometEndpointManager() { + } + + public static void add(String url, RuntimeEndpoint endpoint) { + endpoints.put(url, endpoint); + } + + public static RuntimeEndpoint get(String url) { + return endpoints.get(url); + } + + public static void remove(String url) { + endpoints.remove(url); + } + + public static void clear() { + endpoints.clear(); + } +} diff --git a/sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometOperationManager.java b/sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometOperationManager.java new file mode 100644 index 0000000000..ea6657e786 --- /dev/null +++ b/sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometOperationManager.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.binding.comet.runtime.manager; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import org.apache.tuscany.sca.interfacedef.Operation; + +/** + * Manager for Tuscany comet operations. This is a thread-safe singleton class. + */ +public class CometOperationManager { + + private static final ConcurrentMap operations = new ConcurrentHashMap(); + + private CometOperationManager() { + } + + public static void add(String url, Operation operation) { + operations.put(url, operation); + } + + public static Operation get(String url) { + return operations.get(url); + } + + public static void remove(String url) { + operations.remove(url); + } + + public static void clear() { + operations.clear(); + } +} diff --git a/sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometSessionManager.java b/sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometSessionManager.java new file mode 100644 index 0000000000..59fe8d8f2d --- /dev/null +++ b/sca-java-2.x/branches/2.0-Beta3/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/manager/CometSessionManager.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.binding.comet.runtime.manager; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import org.atmosphere.cpr.Broadcaster; + +/** + * Manager for Tuscany comet sessions. This is a thread-safe singleton class. + */ +public class CometSessionManager { + + private static final ConcurrentMap broadcasters = new ConcurrentHashMap(); + + 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(); + } +} -- cgit v1.2.3