[ 
https://issues.apache.org/jira/browse/CAMEL-12954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16697086#comment-16697086
 ] 

ASF GitHub Bot commented on CAMEL-12954:
----------------------------------------

lburgazzoli commented on a change in pull request #2631: CAMEL-12954 adding 
camel-websocket-jsr356 module
URL: https://github.com/apache/camel/pull/2631#discussion_r235929163
 
 

 ##########
 File path: 
components/camel-websocket-jsr356/src/main/java/org/apache/camel/jsr356/JSR356WebSocketComponent.java
 ##########
 @@ -0,0 +1,100 @@
+/**
+ * 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.camel.jsr356;
+
+import static java.util.Optional.ofNullable;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.websocket.Session;
+import javax.websocket.server.ServerContainer;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.spi.Metadata;
+
+public class JSR356WebSocketComponent extends DefaultComponent {
+    // didn't find a better way to handle that unless we can assume the 
CamelContext is in the ServletContext
+    private static final Map<String, ContextBag> SERVER_CONTAINERS = new 
ConcurrentHashMap<>();
+
+    @Metadata(label = "sessionCount")
+    protected int sessionCount;
+
+    @Override
+    protected Endpoint createEndpoint(final String uri, final String 
remaining, final Map<String, Object> parameters) {
+        return new JSR356Endpoint(this, uri);
+    }
+
+    public void sendMessage(final Session session, final Object message) 
throws IOException {
 
 Review comment:
   looks like a static method

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Add a camel-websocket component 100% using only JSR356
> ------------------------------------------------------
>
>                 Key: CAMEL-12954
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12954
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Romain Manni-Bucau
>            Priority: Major
>             Fix For: Future
>
>
> Goal is to rely on the standard javax specification and not require to setup 
> Atmosphere in containers which now support it



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to