advice = reply.getAdvice(true);
-
- if (browserId != null)
- advice.put("multiple-clients", true);
-
- if (_multiSessionInterval > 0) {
- advice.put(Message.RECONNECT_FIELD, Message.RECONNECT_RETRY_VALUE);
- advice.put(Message.INTERVAL_FIELD, _multiSessionInterval);
- } else {
- advice.put(Message.RECONNECT_FIELD, Message.RECONNECT_NONE_VALUE);
- reply.setSuccessful(false);
- }
- session.reAdvise();
- }
- }
- } finally {
- if (reply != null && session.isConnected())
- session.startIntervalTimeout(getInterval());
- }
- } else {
- if (!isMetaConnectDeliveryOnly() && !session.isMetaConnectDeliveryOnly()) {
- writer = sendQueue(request, response, session, writer);
- }
- }
- }
-
- // If the reply has not been otherwise handled, send it
- if (reply != null) {
- if (connect && session != null && !session.isConnected())
- reply.getAdvice(true).put(Message.RECONNECT_FIELD, Message.RECONNECT_NONE_VALUE);
-
- reply = getBayeux().extendReply(session, session, reply);
-
- if (reply != null) {
- getBayeux().freeze(reply);
- writer = send(request, response, writer, reply);
- }
- }
- }
-
- // Disassociate the reply
- message.setAssociated(null);
- }
- if (writer != null)
- complete(writer);
- } catch (ParseException x) {
- handleJSONParseException(request, response, x.getMessage(), x.getCause());
- } finally {
- // If we started a batch, end it now
- if (batch) {
- boolean ended = session.endBatch();
-
- // Flush session if not done by the batch, since some browser order \n").getBytes()).flushBuffer();
- } catch (IOException e) {
- logger.trace("", e);
- }
- }
-
-
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/IFrameUtils.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/IFrameUtils.java
deleted file mode 100644
index 629b2e8e5..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/IFrameUtils.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.sockjs;
-
-import java.io.UnsupportedEncodingException;
-
-public class IFrameUtils {
-
- public static byte[] generateIFrame(String origin) {
- StringBuilder b = new StringBuilder();
- b.append("\n").append(
- "\n").append(
- "\n").append(
- " \n").append(
- " \n").append(
- " \n").append(
- " \n").append(
- "\n").append(
- "\n").append(
- " Don't panic!
\n").append(
- " This is a SockJS hidden iframe. It's used for cross domain magic.
\n").append(
- "\n").append(
- "");
- try {
- return b.toString().getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- return b.toString().getBytes();
- }
- }
-
- public static byte[] generateHtmlFile(String callback) {
- StringBuilder b = new StringBuilder();
- b.append("\n").append(
- "\n").append(
- " \n").append(
- " \n").append(
- "Don't panic!
\n").append(
- " ");
-
- try {
- return b.toString().getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- return b.toString().getBytes();
- }
-
- }
-
-
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/JSONPTransport.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/JSONPTransport.java
deleted file mode 100644
index 2b71fea7e..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/JSONPTransport.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.sockjs;
-
-import org.atmosphere.cpr.AtmosphereResourceEvent;
-import org.atmosphere.cpr.AtmosphereResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class JSONPTransport extends TransportBasedListener {
- private static final Logger logger = LoggerFactory.getLogger(JSONPTransport.class);
- @Override
- public void onSuspend(AtmosphereResourceEvent event) {
- AtmosphereResponse response = event.getResource().getResponse();
- try {
- response.write("o".getBytes()).flushBuffer();
- } catch (IOException e) {
- logger.trace("", e);
- }
- }
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/JsonCodec.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/JsonCodec.java
deleted file mode 100644
index 63944b24b..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/JsonCodec.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2011-2018 The original author or authors
- * ------------------------------------------------------
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Apache License v2.0 which accompanies this distribution.
- *
- * The Eclipse Public License is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * The Apache License v2.0 is available at
- * http://www.opensource.org/licenses/apache2.0.php
- *
- * You may elect to redistribute this code under either of these licenses.
- */
-
-package org.atmosphere.sockjs;
-
-import com.fasterxml.jackson.core.JsonGenerationException;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.io.CharTypes;
-import com.fasterxml.jackson.core.json.JsonWriteContext;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-
-import java.io.IOException;
-
-/**
- * SockJS requires a special JSON codec - it requires that many other characters,
- * over and above what is required by the JSON spec are escaped.
- * To satisfy this we escape any character that escapable with short escapes and
- * any other non ASCII character we unicode escape it
- *
- * @author Tim Fox
- */
-public class JsonCodec {
-
- private final static ObjectMapper mapper;
-
- static {
- mapper = new ObjectMapper();
-
- // By default, Jackson does not escape unicode characters in JSON strings
- // This should be ok, since a valid JSON string can contain unescaped JSON
- // characters.
- // However, SockJS requires that many unicode chars are escaped. This may
- // be due to browsers barfing over certain unescaped characters
- // So... when encoding strings we make sure all unicode chars are escaped
-
- // This code adapted from http://wiki.fasterxml.com/JacksonSampleQuoteChars
- SimpleModule simpleModule = new SimpleModule();
-
- simpleModule.addSerializer(String.class, new JsonSerializer() {
- final char[] HEX_CHARS = "0123456789abcdef".toCharArray();
- final int[] ESCAPE_CODES = CharTypes.get7BitOutputEscapes();
-
- private void writeUnicodeEscape(JsonGenerator gen, char c) throws IOException {
- gen.writeRaw('\\');
- gen.writeRaw('u');
- gen.writeRaw(HEX_CHARS[(c >> 12) & 0xF]);
- gen.writeRaw(HEX_CHARS[(c >> 8) & 0xF]);
- gen.writeRaw(HEX_CHARS[(c >> 4) & 0xF]);
- gen.writeRaw(HEX_CHARS[c & 0xF]);
- }
-
- private void writeShortEscape(JsonGenerator gen, char c) throws IOException {
- gen.writeRaw('\\');
- gen.writeRaw(c);
- }
-
- @Override
- public void serialize(String str, JsonGenerator gen, SerializerProvider provider) throws IOException {
- int status = ((JsonWriteContext) gen.getOutputContext()).writeValue();
- switch (status) {
- case JsonWriteContext.STATUS_OK_AFTER_COLON:
- gen.writeRaw(':');
- break;
- case JsonWriteContext.STATUS_OK_AFTER_COMMA:
- gen.writeRaw(',');
- break;
- case JsonWriteContext.STATUS_EXPECT_NAME:
- throw new JsonGenerationException("Can not write string value here");
- }
- gen.writeRaw('"');
- for (char c : str.toCharArray()) {
- if (c >= 0x80) writeUnicodeEscape(gen, c); // use generic escaping for all non US-ASCII characters
- else {
- // use escape table for first 128 characters
- int code = (c < ESCAPE_CODES.length ? ESCAPE_CODES[c] : 0);
- if (code == 0) gen.writeRaw(c); // no escaping
- else if (code == -1) writeUnicodeEscape(gen, c); // generic escaping
- else writeShortEscape(gen, (char) code); // short escaping (\n \t ...)
- }
- }
- gen.writeRaw('"');
- }
- });
- mapper.registerModule(simpleModule);
- }
-
- public static String encode(Object obj) {
- try {
- return mapper.writeValueAsString(obj);
- } catch (JsonProcessingException e) {
- return null;
- }
- }
-
- public static Object decodeValue(String str, Class> clazz) {
- try {
- return mapper.readValue(str, clazz);
- } catch (IOException e) {
- return null;
- }
- }
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/LongPollingTransport.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/LongPollingTransport.java
deleted file mode 100644
index b6b328c85..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/LongPollingTransport.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.sockjs;
-
-import org.atmosphere.cpr.AtmosphereResourceEvent;
-import org.atmosphere.cpr.AtmosphereResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class LongPollingTransport extends TransportBasedListener {
- private static final Logger logger = LoggerFactory.getLogger(LongPollingTransport.class);
-
- @Override
- public void onSuspend(AtmosphereResourceEvent event) {
- AtmosphereResponse response = event.getResource().getResponse();
- response.setContentType("application/javascript");
- try {
- response.write("o\r\n\r\n".getBytes(), true).flushBuffer();
- response.closeStreamOrWriter();
- } catch (IOException e) {
- logger.trace("", e);
- }
-
- }
-
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/SSETransport.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/SSETransport.java
deleted file mode 100644
index 31f4c2ba3..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/SSETransport.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.sockjs;
-
-import org.atmosphere.cpr.AtmosphereResourceEvent;
-import org.atmosphere.cpr.AtmosphereResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class SSETransport extends TransportBasedListener {
- private static final Logger logger = LoggerFactory.getLogger(SSETransport.class);
- @Override
- public void onSuspend(AtmosphereResourceEvent event) {
- AtmosphereResponse response = event.getResource().getResponse();
- try {
- response.write("o".getBytes()).flushBuffer();
- } catch (IOException e) {
- logger.trace("", e);
- }
- }
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/SockJsAtmosphereInterceptor.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/SockJsAtmosphereInterceptor.java
deleted file mode 100644
index 20978545f..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/SockJsAtmosphereInterceptor.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.sockjs;
-
-import com.fasterxml.jackson.databind.node.JsonNodeFactory;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-import org.atmosphere.cpr.Action;
-import org.atmosphere.cpr.AsyncIOInterceptorAdapter;
-import org.atmosphere.cpr.AsyncIOWriter;
-import org.atmosphere.cpr.AtmosphereConfig;
-import org.atmosphere.cpr.AtmosphereFramework;
-import org.atmosphere.cpr.AtmosphereHandler;
-import org.atmosphere.cpr.AtmosphereInterceptor;
-import org.atmosphere.cpr.AtmosphereInterceptorAdapter;
-import org.atmosphere.cpr.AtmosphereInterceptorWriter;
-import org.atmosphere.cpr.AtmosphereRequest;
-import org.atmosphere.cpr.AtmosphereResource;
-import org.atmosphere.cpr.AtmosphereResourceEvent;
-import org.atmosphere.cpr.AtmosphereResourceEventListenerAdapter;
-import org.atmosphere.cpr.AtmosphereResourceImpl;
-import org.atmosphere.cpr.AtmosphereResponse;
-import org.atmosphere.cpr.HeaderConfig;
-import org.atmosphere.handler.AbstractReflectorAtmosphereHandler;
-import org.atmosphere.interceptor.HeartbeatInterceptor;
-import org.atmosphere.util.IOUtils;
-import org.atmosphere.util.StringEscapeUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.ServletException;
-
-import java.io.IOException;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.WeakHashMap;
-import java.util.concurrent.atomic.AtomicReference;
-
-import static org.atmosphere.cpr.AtmosphereResource.TRANSPORT.HTMLFILE;
-import static org.atmosphere.cpr.AtmosphereResource.TRANSPORT.JSONP;
-import static org.atmosphere.cpr.AtmosphereResource.TRANSPORT.LONG_POLLING;
-import static org.atmosphere.cpr.AtmosphereResource.TRANSPORT.POLLING;
-import static org.atmosphere.cpr.AtmosphereResource.TRANSPORT.SSE;
-import static org.atmosphere.cpr.AtmosphereResource.TRANSPORT.STREAMING;
-import static org.atmosphere.cpr.AtmosphereResource.TRANSPORT.UNDEFINED;
-import static org.atmosphere.cpr.AtmosphereResource.TRANSPORT.WEBSOCKET;
-
-public class SockJsAtmosphereInterceptor extends AtmosphereInterceptorAdapter {
-
- public final static String SOCKS_JS_ORIGIN = SockJsAtmosphereInterceptor.class.getName() + ".origin";
-
- private static final Logger logger = LoggerFactory.getLogger(SockJsAtmosphereInterceptor.class);
- private boolean supportWebSocket = true;
- private final AtomicReference baseURL = new AtomicReference("");
- private AtmosphereFramework framework;
- private final Map sessions = Collections.synchronizedMap(new WeakHashMap());
-
- public final static AtmosphereHandler ECHO_ATMOSPHEREHANDLER = new AbstractReflectorAtmosphereHandler() {
- @Override
- public void onRequest(AtmosphereResource resource) throws IOException {
- String body = IOUtils.readEntirely(resource).toString();
- if (!body.isEmpty()) {
- resource.getBroadcaster().broadcast(body);
- }
- }
- };
-
- @Override
- public void configure(final AtmosphereConfig config) {
- framework = config.framework();
- supportWebSocket = config.framework().getAsyncSupport().supportWebSocket();
- config.properties().put(HeaderConfig.JSONP_CALLBACK_NAME, "c");
- for (AtmosphereInterceptor i : framework.interceptors()) {
- if (HeartbeatInterceptor.class.isAssignableFrom(i.getClass())) {
- HeartbeatInterceptor.class.cast(i).paddingText("h".getBytes()).heartbeatFrequencyInSeconds(25);
- }
- }
-
- if (config.handlers().size() == 0) {
- framework.addAtmosphereHandler("/*", ECHO_ATMOSPHEREHANDLER);
- }
- }
-
- @Override
- public Action inspect(final AtmosphereResource r) {
- final AtmosphereRequest request = r.getRequest();
-
- if (request.getAttribute("sockjs.skipInterceptor") != null) {
- return Action.CONTINUE;
- }
-
- boolean info = request.getRequestURI().endsWith("/info");
- if (info) {
- return info(r);
- }
-
- boolean iframe = request.getRequestURI().endsWith("/iframe.html");
- if (iframe) {
- return iframe(r);
- }
-
- if (!baseURL.get().isEmpty() && request.getRequestURI().startsWith(baseURL.get())) {
- super.inspect(r);
-
- // See https://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html#section-36
- // The URL received from the client should be similar to the following:
- // ///
- // The auxiliar params method will handle this URL processing
- String[] params = params(request.getRequestURI().substring(baseURL.get().length()), 2);
- final String sessionId = params[0];
- String transport = params[1];
-
- SockjsSession s = sessions.get(sessionId);
- configureTransport(AtmosphereResourceImpl.class.cast(r), transport, s != null);
- boolean longPolling = org.atmosphere.util.Utils.resumableTransport(r.transport());
-
- if (s == null) {
- sessions.put(sessionId, new SockjsSession());
- if (!longPolling) {
- installWriter(r, sessionId);
- }
- return Action.CONTINUE;
- } else if (longPolling) {
- installWriter(r, sessionId);
- return Action.CONTINUE;
- }
-
- return injectMessage(r);
- }
- return Action.CONTINUE;
- }
-
- private Action iframe(AtmosphereResource r) {
- final AtmosphereResponse response = r.getResponse();
- response.setContentType("text/html");
- String origin = framework.getAtmosphereConfig().getInitParameter(SOCKS_JS_ORIGIN);
- if (origin == null) {
- origin = "http://localhost:8080/lib/sockjs.js";
- }
- try {
- response.write(IFrameUtils.generateIFrame(origin)).flushBuffer();
- } catch (IOException e) {
- logger.error("", e);
- }
- return Action.CANCELLED;
- }
-
- protected Action info(AtmosphereResource r) {
- final AtmosphereResponse response = r.getResponse();
- final AtmosphereRequest request = r.getRequest();
-
- response.headers().put("Content-Type", "application/json; charset=UTF-8");
- ObjectNode json = new ObjectNode(JsonNodeFactory.instance);
- json.put("websocket", supportWebSocket);
- json.putArray("origins").add("*:*");
- json.put("entropy", new Random().nextInt());
- r.write(JsonCodec.encode(json));
-
- if (baseURL.get().isEmpty()) {
- baseURL.set(request.getRequestURI().substring(0, request.getRequestURI().indexOf("/info")));
- }
-
- return Action.CANCELLED;
- }
-
- private static String[] params(String urlFragment, int pos) {
- if (pos <= 0) {
- throw new IllegalArgumentException("pos must be greater then zero");
- }
-
- String s = urlFragment;
- int currPos = 0;
- if (s.startsWith("/")) {
- currPos++;
- }
-
- List params = new ArrayList();
- int slashPos = -1;
- String token = null;
- while (params.size() < pos) {
- slashPos = s.indexOf('/', currPos);
- if (slashPos > 0) {
- token = s.substring(currPos, slashPos);
- currPos = slashPos + 1;
- params.add(token);
- } else {
- break;
- }
- }
-
- if (params.size() < pos) {
- throw new IllegalArgumentException(
- String.format("the number of tokens in the url fragment passed as argument '%s' is less than the number required %d", urlFragment, pos));
- }
-
- return params.toArray(new String[params.size()]);
- }
-
- private void configureTransport(AtmosphereResourceImpl r, String s, boolean hasSession) {
- if ("websocket".equals(s)) {
- r.transport(WEBSOCKET).addEventListener(new WebSocketTransport());
- } else if ("xhr".equals(s) || "xdr".equals(s)) {
- r.transport(LONG_POLLING);
-
- if (!hasSession) {
- r.addEventListener(new LongPollingTransport());
- }
- } else if ("xhr_streaming".equals(s)) {
- r.transport(STREAMING).addEventListener(new StreamingTransport());
- } else if ("jsonp".equals(s)) {
- r.transport(JSONP);
-
- if (!hasSession) {
- r.addEventListener(new JSONPTransport());
- }
- } else if ("eventsource".equals(s)) {
- r.transport(SSE).addEventListener(new SSETransport());
- } else if (s.indexOf("_send") != -1) {
- r.transport(POLLING);
- } else if ("htmlfile".equals(s)) {
- r.transport(HTMLFILE).addEventListener(new HtmlFileTransport());
- } else if (s.indexOf("_send") != -1) {
- } else {
- r.transport(UNDEFINED).addEventListener(new StreamingTransport());
- }
- }
-
- private void installWriter(final AtmosphereResource r, final String sessionId) {
- final AtmosphereResource.TRANSPORT transport = r.transport();
- final AtmosphereResponse response = r.getResponse();
-
- AsyncIOWriter writer = response.getAsyncIOWriter();
- if (AtmosphereInterceptorWriter.class.isAssignableFrom(writer.getClass())) {
- AtmosphereInterceptorWriter.class.cast(writer).interceptor(new AsyncIOInterceptorAdapter() {
- @Override
- public byte[] transformPayload(AtmosphereResponse response, byte[] responseDraft, byte[] data) throws IOException {
- String charEncoding = response.getCharacterEncoding() == null ? "UTF-8" : response.getCharacterEncoding();
- String s = new String(responseDraft, charEncoding);
-
- // Ugly.
- if (s.equalsIgnoreCase("h") || s.equals("c") || (s.equals("o\n") && r.transport().equals(AtmosphereResource.TRANSPORT.WEBSOCKET))) {
- return s.getBytes();
- }
-
- if (!s.isEmpty()) {
- try {
- if (transport.equals(JSONP)) {
- return ("a" + s).getBytes(charEncoding);
- } else if (transport.equals(HTMLFILE)) {
- StringBuilder sb = new StringBuilder();
- sb.append("\n");
- return (sb.toString()).getBytes(charEncoding);
- } else {
- return ("a[\"" + StringEscapeUtils.escapeJavaScript(s) + "\"]\n").getBytes(charEncoding);
-
- }
- } catch (Exception e) {
- logger.error("", e);
- return "".getBytes();
- }
- }
-
- return s.getBytes();
- }
- });
- } else {
- logger.warn("Unable to apply {}. Your AsyncIOWriter must implement {}", getClass().getName(), AtmosphereInterceptorWriter.class.getName());
- }
-
- r.addEventListener(new AtmosphereResourceEventListenerAdapter() {
- @Override
- public void onDisconnect(AtmosphereResourceEvent event) {
- sessions.remove(sessionId);
- }
- });
- }
-
- private Action injectMessage(AtmosphereResource r) {
- final AtmosphereResponse response = r.getResponse();
- final AtmosphereRequest request = r.getRequest();
-
- try {
- String body = IOUtils.readEntirely(r).toString();
- if (!body.isEmpty() && body.startsWith("d=")) {
- body = URLDecoder.decode(body, "UTF-8");
- body = body.substring(2);
- response.setStatus(200);
- response.write("ok", true).flushBuffer();
- reInject(request, response, body);
- } else {
- String[] messages = parseMessageString(body);
- for (String m : messages) {
- if (m == null) continue;
- reInject(request, response, m);
- }
- response.setStatus(204);
- }
- } catch (Exception e) {
- logger.error("", e);
- }
- return Action.CANCELLED;
- }
-
- private void reInject(AtmosphereRequest request, AtmosphereResponse response, String body) throws IOException, ServletException {
- request.setAttribute("sockjs.skipInterceptor", Boolean.TRUE);
- framework.doCometSupport(request.body(body), response);
- request.setAttribute("sockjs.skipInterceptor", null);
- }
-
- private String[] parseMessageString(String msgs) {
- try {
- String[] parts;
- if (msgs.startsWith("[")) {
- //JSON array
- parts = (String[]) JsonCodec.decodeValue(msgs, String[].class);
- } else {
- //JSON string
- String str = (String) JsonCodec.decodeValue(msgs, String.class);
- parts = new String[]{str};
- }
- return parts;
- } catch (Exception e) {
- return null;
- }
- }
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/SockjsSession.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/SockjsSession.java
deleted file mode 100644
index 684083d1b..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/SockjsSession.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.sockjs;
-
-public class SockjsSession {
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/StreamingTransport.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/StreamingTransport.java
deleted file mode 100644
index 257c682ae..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/StreamingTransport.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.sockjs;
-
-import org.atmosphere.cpr.AtmosphereResourceEvent;
-import org.atmosphere.cpr.AtmosphereResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class StreamingTransport extends TransportBasedListener {
- private static final Logger logger = LoggerFactory.getLogger(StreamingTransport.class);
-
- private static final byte[] padding;
- private static final String paddingText;
-
- static {
- StringBuilder whitespace = new StringBuilder();
- for (int i = 0; i < 2048; i++) {
- whitespace.append("h");
- }
- whitespace.append("\n");
- paddingText = whitespace.toString();
- padding = paddingText.getBytes();
- }
-
- @Override
- public void onPreSuspend(AtmosphereResourceEvent event) {
- AtmosphereResponse response = event.getResource().getResponse();
- response.setContentType("application/javascript");
- try {
-
- response.write(padding, true).flushBuffer();
- response.write("o\n".getBytes(), true).flushBuffer();
- } catch (IOException e) {
- logger.trace("", e);
- }
- }
-
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/TransportBasedListener.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/TransportBasedListener.java
deleted file mode 100644
index 7d102c9e8..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/TransportBasedListener.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.sockjs;
-
-import org.atmosphere.cpr.AtmosphereResourceEvent;
-import org.atmosphere.cpr.AtmosphereResourceEventListenerAdapter;
-
-public class TransportBasedListener extends AtmosphereResourceEventListenerAdapter {
- @Override
- public void onClose(AtmosphereResourceEvent event) {
- StringBuilder sb = new StringBuilder("c[");
- // TODO: Code
- sb.append(String.valueOf("500")).append(",\"");
- sb.append("Closed").append("\"]");
- event.getResource().write(sb.toString());
- }
-}
diff --git a/sockjs/modules/src/main/java/org/atmosphere/sockjs/WebSocketTransport.java b/sockjs/modules/src/main/java/org/atmosphere/sockjs/WebSocketTransport.java
deleted file mode 100644
index 9b69b503f..000000000
--- a/sockjs/modules/src/main/java/org/atmosphere/sockjs/WebSocketTransport.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.sockjs;
-
-import org.atmosphere.cpr.AtmosphereResourceEvent;
-import org.atmosphere.cpr.AtmosphereResponse;
-
-public class WebSocketTransport extends TransportBasedListener {
- @Override
- public void onPreSuspend(AtmosphereResourceEvent event) {
- AtmosphereResponse response = event.getResource().getResponse();
- response.setContentType("text/plain");
-
- response.write("o\n".getBytes());
- }
-}
diff --git a/sockjs/modules/src/main/resources/META-INF/services/org.atmosphere.cpr.AtmosphereFramework b/sockjs/modules/src/main/resources/META-INF/services/org.atmosphere.cpr.AtmosphereFramework
deleted file mode 100644
index 6462ea3d3..000000000
--- a/sockjs/modules/src/main/resources/META-INF/services/org.atmosphere.cpr.AtmosphereFramework
+++ /dev/null
@@ -1,4 +0,0 @@
-INSTALL
-org.atmosphere.sockjs.SockJsAtmosphereInterceptor
-EXCLUDE
-org.atmosphere.client.TrackMessageSizeInterceptor
\ No newline at end of file
diff --git a/spring/modules/pom.xml b/spring/modules/pom.xml
index a1813a334..87b34b177 100644
--- a/spring/modules/pom.xml
+++ b/spring/modules/pom.xml
@@ -3,13 +3,13 @@
org.atmosphere
atmosphere-extensions-project
- 2.6.6-SNAPSHOT
+ 3.0.0-SNAPSHOT
../../pom.xml
org.atmosphere
atmosphere-spring
jar
- 2.6.6-SNAPSHOT
+ 3.0.0-SNAPSHOT
atmosphere-spring
https://github.com/Atmosphere/atmosphere
@@ -17,7 +17,7 @@
org.atmosphere
atmosphere-runtime
- ${atmosphere3-version}
+ ${atmosphere-version}
jakarta.servlet
@@ -32,4 +32,8 @@
${spring-version}
+
+
+ none
+
diff --git a/weblogic/modules/pom.xml b/weblogic/modules/pom.xml
deleted file mode 100755
index 4b88a6b12..000000000
--- a/weblogic/modules/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
- org.atmosphere
- atmosphere-extensions-project
- 2.6.6-SNAPSHOT
- ../../pom.xml
-
- 4.0.0
- org.atmosphere
- atmosphere-weblogic
- bundle
- 2.6.6-SNAPSHOT
- atmosphere-weblogic
- https://github.com/Atmosphere/atmosphere
-
- install
-
-
- src/main/resources
-
-
-
-
- src/test/resources
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
- ${felix-version}
- true
-
-
- *
-
- org.atmosphere.weblogic.*
-
-
-
-
-
- osgi-bundle
- package
-
- bundle
-
-
-
-
-
-
-
-
- org.atmosphere
- atmosphere-runtime
- ${atmosphere-version}
- provided
-
-
- javax.servlet
- javax.servlet-api
- ${servlet-version}
- provided
-
-
-
diff --git a/weblogic/modules/src/main/java/org/atmosphere/weblogic/AtmosphereWebLogicServlet.java b/weblogic/modules/src/main/java/org/atmosphere/weblogic/AtmosphereWebLogicServlet.java
deleted file mode 100644
index d67ff9795..000000000
--- a/weblogic/modules/src/main/java/org/atmosphere/weblogic/AtmosphereWebLogicServlet.java
+++ /dev/null
@@ -1,137 +0,0 @@
- /*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.weblogic;
-
- import org.atmosphere.cpr.Action;
-import org.atmosphere.cpr.AsynchronousProcessor;
-import org.atmosphere.cpr.AtmosphereFramework;
-import org.atmosphere.cpr.AtmosphereRequestImpl;
-import org.atmosphere.cpr.AtmosphereResponseImpl;
-import org.atmosphere.cpr.AtmosphereServlet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import weblogic.servlet.http.AbstractAsyncServlet;
-import weblogic.servlet.http.RequestResponseKey;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import java.io.IOException;
-
-import org.atmosphere.cpr.AtmosphereRequest;
-import org.atmosphere.cpr.AtmosphereResponse;
-
-/**
- * WebLogic Comet implementation.
- */
-public class AtmosphereWebLogicServlet extends AbstractAsyncServlet {
-
- protected static final Logger logger = LoggerFactory.getLogger(AtmosphereServlet.class);
- protected AtmosphereFramework framework;
-
- /**
- * Create an Atmosphere Servlet.
- */
- public AtmosphereWebLogicServlet() {
- this(false);
- }
-
- /**
- * Create an Atmosphere Servlet.
- *
- * @param isFilter true if this instance is used as an {@link org.atmosphere.cpr.AtmosphereFilter}
- */
- public AtmosphereWebLogicServlet(boolean isFilter) {
- this(isFilter, true);
- }
-
- /**
- * Create an Atmosphere Servlet.
- *
- * @param isFilter true if this instance is used as an {@link org.atmosphere.cpr.AtmosphereFilter}
- */
- public AtmosphereWebLogicServlet(boolean isFilter, boolean autoDetectHandlers) {
- framework = new AtmosphereFramework(isFilter, autoDetectHandlers);
- }
-
- @Override
- public void destroy() {
- framework.destroy();
- }
-
- public void init(final ServletConfig sc) throws ServletException {
- super.init(sc);
- framework.setAsyncSupport(new WebLogicCometSupport(framework.getAtmosphereConfig()));
- framework.init(sc);
- }
-
- public AtmosphereFramework framework() {
- return framework;
- }
-
- /**
- * Weblogic specific comet based implementation.
- *
- * @param rrk
- * @return true if suspended
- * @throws java.io.IOException
- * @throws javax.servlet.ServletException
- */
- protected boolean doRequest(RequestResponseKey rrk) throws IOException, ServletException {
- try {
- AtmosphereRequest req = AtmosphereRequestImpl.wrap(rrk.getRequest());
- AtmosphereResponse resp = AtmosphereResponseImpl.wrap(rrk.getResponse());
- Action action = framework.doCometSupport(req , resp);
- rrk.getRequest().getSession().setAttribute(WebLogicCometSupport.RRK + resp.uuid(), rrk);
- if (action.type() == Action.TYPE.SUSPEND) {
- if (action.timeout() == -1) {
- rrk.setTimeout(Integer.MAX_VALUE);
- } else {
- rrk.setTimeout((int) action.timeout());
- }
- }
- return action.type() == Action.TYPE.SUSPEND;
- } catch (IllegalStateException ex) {
- logger.error("AtmosphereServlet.doRequest exception", ex);
- throw ex;
- }
- }
-
- /**
- * Weblogic specific comet based implementation.
- *
- * @param rrk
- * @throws java.io.IOException
- * @throws javax.servlet.ServletException
- */
- protected void doResponse(RequestResponseKey rrk, Object context)
- throws IOException, ServletException {
- rrk.getResponse().flushBuffer();
- }
-
- /**
- * Weblogic specific comet based implementation.
- *
- * @param rrk
- * @throws java.io.IOException
- * @throws javax.servlet.ServletException
- */
- protected void doTimeout(RequestResponseKey rrk) throws IOException, ServletException {
- ((AsynchronousProcessor) framework.getAsyncSupport()).timedout(AtmosphereRequestImpl.wrap(rrk.getRequest()),
- AtmosphereResponseImpl.wrap(rrk.getResponse()));
- }
-
-
-}
diff --git a/weblogic/modules/src/main/java/org/atmosphere/weblogic/WebLogicCometSupport.java b/weblogic/modules/src/main/java/org/atmosphere/weblogic/WebLogicCometSupport.java
deleted file mode 100644
index 753652d1b..000000000
--- a/weblogic/modules/src/main/java/org/atmosphere/weblogic/WebLogicCometSupport.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.
- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2007-2008 Sun Microsystems, Inc. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can obtain
- * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
- * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
- * Sun designates this particular file as subject to the "Classpath" exception
- * as provided by Sun in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the License
- * Header, with the fields enclosed by brackets [] replaced by your own
- * identifying information: "Portions Copyrighted [year]
- * [name of copyright owner]"
- *
- * Contributor(s):
- *
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- *
- */
-package org.atmosphere.weblogic;
-
-import org.atmosphere.cpr.Action;
-import org.atmosphere.cpr.ApplicationConfig;
-import org.atmosphere.cpr.AsynchronousProcessor;
-import org.atmosphere.cpr.AtmosphereConfig;
-import org.atmosphere.cpr.AtmosphereRequest;
-import org.atmosphere.cpr.AtmosphereResourceImpl;
-import org.atmosphere.cpr.AtmosphereResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import weblogic.servlet.http.AbstractAsyncServlet;
-import weblogic.servlet.http.RequestResponseKey;
-
-import javax.servlet.ServletException;
-import java.io.IOException;
-
-/**
- * Weblogic support.
- *
- * @author Jeanfrancois Arcand
- */
-public class WebLogicCometSupport extends AsynchronousProcessor {
-
- private static final Logger logger = LoggerFactory.getLogger(WebLogicCometSupport.class);
-
- public static final String RRK = "RequestResponseKey-";
-
- public WebLogicCometSupport(AtmosphereConfig config) {
- super(config);
- }
-
- /**
- * {@inheritDoc}
- */
- public Action service(AtmosphereRequest req, AtmosphereResponse res)
- throws IOException, ServletException {
- Action action = suspended(req, res);
- if (action.type() == Action.TYPE.SUSPEND) {
- logger.debug("Suspending response: {}", res);
- } else if (action.type() == Action.TYPE.RESUME) {
- logger.debug("Resuming response: {}", res);
-
- Action nextAction = resumed(req, res);
- if (nextAction.type() == Action.TYPE.SUSPEND) {
- logger.debug("Suspending after resuming response: {}", res);
- }
- }
- return action;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void action(AtmosphereResourceImpl actionEvent) {
- super.action(actionEvent);
- if (actionEvent.isInScope() && actionEvent.action().type() == Action.TYPE.RESUME) {
- try {
- RequestResponseKey rrk = (RequestResponseKey) actionEvent.getRequest().getSession().getAttribute(RRK + actionEvent.uuid());
- AbstractAsyncServlet.notify(rrk, null);
- } catch (IOException ex) {
- logger.debug("action failed", ex);
- }
- }
- }
-
-}
diff --git a/weblogic/modules/src/main/java/weblogic/servlet/http/AbstractAsyncServlet.java b/weblogic/modules/src/main/java/weblogic/servlet/http/AbstractAsyncServlet.java
deleted file mode 100755
index 7272b14d7..000000000
--- a/weblogic/modules/src/main/java/weblogic/servlet/http/AbstractAsyncServlet.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.
- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2007-2008 Sun Microsystems, Inc. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can obtain
- * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
- * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
- * Sun designates this particular file as subject to the "Classpath" exception
- * as provided by Sun in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the License
- * Header, with the fields enclosed by brackets [] replaced by your own
- * identifying information: "Portions Copyrighted [year]
- * [name of copyright owner]"
- *
- * Contributor(s):
- *
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- *
- */
-package weblogic.servlet.http;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import java.io.IOException;
-
-/**
- * Fake support for Weblogic. Weblogic jars aren't public and not available with
- * any repository, so fake them.
- *
- * @author Jeanfrancois Arcand
- */
-public abstract class AbstractAsyncServlet extends HttpServlet {
-
- protected abstract boolean doRequest(RequestResponseKey rrk)
- throws IOException, ServletException;
-
- protected abstract void doResponse(RequestResponseKey rrk, Object o)
- throws IOException, ServletException;
-
- protected abstract void doTimeout(RequestResponseKey rrk)
- throws IOException, ServletException;
-
- public final static void notify(RequestResponseKey rrk, Object context) throws IOException {
- return;
- }
-
-}
diff --git a/weblogic/modules/src/main/java/weblogic/servlet/http/RequestResponseKey.java b/weblogic/modules/src/main/java/weblogic/servlet/http/RequestResponseKey.java
deleted file mode 100755
index 078f95bd3..000000000
--- a/weblogic/modules/src/main/java/weblogic/servlet/http/RequestResponseKey.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.
- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2007-2008 Sun Microsystems, Inc. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can obtain
- * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
- * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
- * Sun designates this particular file as subject to the "Classpath" exception
- * as provided by Sun in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the License
- * Header, with the fields enclosed by brackets [] replaced by your own
- * identifying information: "Portions Copyrighted [year]
- * [name of copyright owner]"
- *
- * Contributor(s):
- *
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- *
- */
-
-package weblogic.servlet.http;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Fake Weblogic class to allow compilation of support for that web container.
- *
- * @author Jeanfrancois Arcand
- */
-public class RequestResponseKey {
- public HttpServletRequest getRequest() {
- throw new UnsupportedOperationException("Please remove the atmosphere-compat-weblogic from your classpath");
- }
-
- public HttpServletResponse getResponse() {
- throw new UnsupportedOperationException("Please remove the atmosphere-compat-weblogic from your classpath");
- }
-
- public void setTimeout(int i) {
- throw new UnsupportedOperationException("Please remove the atmosphere-compat-weblogic from your classpath");
- }
-}
diff --git a/xmpp/modules/pom.xml b/xmpp/modules/pom.xml
deleted file mode 100755
index 45d63b1f3..000000000
--- a/xmpp/modules/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
- org.atmosphere
- atmosphere-extensions-project
- 2.6.6-SNAPSHOT
- ../../pom.xml
-
- 4.0.0
- org.atmosphere
- atmosphere-xmpp
- bundle
- 2.6.6-SNAPSHOT
- atmosphere-xmpp
- https://github.com/Atmosphere/atmosphere
-
- install
-
-
- org.apache.felix
- maven-bundle-plugin
- ${felix-version}
- true
-
-
- *
-
- org.atmosphere.plugin.xmpp.*
-
-
-
-
-
- osgi-bundle
- package
-
- bundle
-
-
-
-
-
-
-
-
- org.atmosphere
- atmosphere-jersey
- ${atmosphere-version}
- provided
-
-
- jivesoftware
- smack
- 3.1.0
-
-
- javax.servlet
- javax.servlet-api
- ${servlet-version}
- provided
-
-
-
diff --git a/xmpp/modules/src/main/java/org/atmosphere/plugin/xmpp/XMPPBroadcaster.java b/xmpp/modules/src/main/java/org/atmosphere/plugin/xmpp/XMPPBroadcaster.java
deleted file mode 100644
index 84374e78c..000000000
--- a/xmpp/modules/src/main/java/org/atmosphere/plugin/xmpp/XMPPBroadcaster.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright 2008-2022 Async-IO.org
- *
- * Licensed 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.atmosphere.plugin.xmpp;
-
-
-import org.atmosphere.cpr.AtmosphereConfig;
-import org.atmosphere.cpr.Broadcaster;
-import org.atmosphere.util.AbstractBroadcasterProxy;
-import org.jivesoftware.smack.Chat;
-import org.jivesoftware.smack.ConnectionConfiguration;
-import org.jivesoftware.smack.MessageListener;
-import org.jivesoftware.smack.SASLAuthentication;
-import org.jivesoftware.smack.XMPPConnection;
-import org.jivesoftware.smack.XMPPException;
-import org.jivesoftware.smack.packet.Message;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.URI;
-
-/**
- * Simple {@link org.atmosphere.cpr.Broadcaster} implementation based on Smack, and XMPP library.
- *
- * @author Jeanfrancois Arcand
- */
-public class XMPPBroadcaster extends AbstractBroadcasterProxy {
-
- private static final Logger logger = LoggerFactory.getLogger(XMPPBroadcaster.class);
-
- private static final String XMPP_AUTH = XMPPBroadcaster.class.getName() + ".authorization";
- private static final String XMPP_SERVER = XMPPBroadcaster.class.getName() + ".server";
- private static final String XMPP_DEBUG = XMPPBroadcaster.class.getName() + ".debug";
-
- private String authToken;
- private XMPPConnection xmppConnection;
- private Chat channel;
-
- public XMPPBroadcaster() {}
-
- public Broadcaster initialize(String id, AtmosphereConfig config) {
- return initialize(id, URI.create("http://gmail.com"), config);
- }
-
- public Broadcaster initialize(String id, URI uri, AtmosphereConfig config) {
- return initialize(id, uri, config);
- }
-
- private synchronized void setUp() {
-
- try {
-
- if (config != null) {
- if (config.getServletConfig().getInitParameter(XMPP_AUTH) != null) {
- authToken = config.getServletConfig().getInitParameter(XMPP_AUTH);
- } else {
- throw new IllegalStateException("No authorization token specified. Please make sure your web.xml contains:" +
- "\n \n" +
- " org.atmosphere.plugin.xmpp.XMPPBroadcaster.authorization\n" +
- " principal:password\n" +
- " ");
- }
-
- if (config.getServletConfig().getInitParameter(XMPP_SERVER) != null) {
- uri = URI.create(config.getServletConfig().getInitParameter(XMPP_SERVER));
- } else if (uri == null) {
- throw new NullPointerException("uri cannot be null");
- }
-
- if (config.getServletConfig().getInitParameter(XMPP_DEBUG) != null) {
- XMPPConnection.DEBUG_ENABLED = true;
- }
- }
-
- ConnectionConfiguration config = null;
- int port = -1;
- try {
- port = uri.getPort();
- } catch (Throwable t) {
- ;
- }
- if (port == -1) {
- config = new ConnectionConfiguration(uri.getHost());
- } else {
- config = new ConnectionConfiguration(uri.getHost(), port);
-
- }
-
- xmppConnection = new XMPPConnection(config);
- xmppConnection.connect();
- SASLAuthentication.supportSASLMechanism("PLAIN", 0);
- String[] credentials = authToken.split(":");
-
- xmppConnection.login(credentials[0], credentials[1], getID());
-
- logger.info("Subscribing to: " + getID());
- channel = xmppConnection.getChatManager().createChat(getID(), new MessageListener() {
-
- public void processMessage(Chat chat, Message message) {
- broadcastReceivedMessage(message.getBody());
- }
- });
-
- logger.info("Connected to: " + getID());
- } catch (Throwable t) {
- throw new RuntimeException(t);
- }
- }
-
- @Override
- public void setID(String id) {
- super.setID(id);
- setUp();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void destroy() {
- super.destroy();
- synchronized (xmppConnection) {
- if (xmppConnection != null) {
- xmppConnection.disconnect();
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void incomingBroadcast() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void outgoingBroadcast(Object message) {
- if (message instanceof String) {
- try {
- channel.sendMessage(message.toString());
- } catch (XMPPException e) {
- logger.debug("failed to send message on channel", e);
- }
- }
- }
-}
\ No newline at end of file