From 120e0e59ca01ddc02ed96162585830763cec59fc Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 11 Dec 2013 17:27:58 -0700 Subject: [PATCH] Cleanup (Imports / StandardCharset / Dead APIs) --- .../jsr356/MessageHandlerWrapper.java | 2 - .../AnnotatedEndpointMetadata.java | 4 -- .../jsr356/annotations/IJsrMethod.java | 1 - .../jsr356/annotations/JsrEvents.java | 4 -- .../jsr356/annotations/JsrParamIdBinary.java | 2 - .../jsr356/annotations/JsrParamIdDecoder.java | 3 - .../jsr356/annotations/JsrParamIdOnClose.java | 1 - .../jsr356/annotations/JsrParamIdOnError.java | 2 - .../jsr356/annotations/JsrParamIdOnOpen.java | 1 - .../jsr356/annotations/JsrParamIdText.java | 2 - .../jsr356/annotations/OnCloseCallable.java | 1 - .../jsr356/annotations/OnErrorCallable.java | 1 - .../annotations/OnMessageBinaryCallable.java | 1 - .../OnMessageBinaryStreamCallable.java | 1 - .../annotations/OnMessagePongCallable.java | 2 - .../annotations/OnMessageTextCallable.java | 2 - .../OnMessageTextStreamCallable.java | 1 - .../jsr356/annotations/OnOpenCallable.java | 1 - .../endpoints/JsrAnnotatedEventDriver.java | 1 - .../messages/BinaryPartialOnMessage.java | 2 - .../jsr356/messages/TextPartialOnMessage.java | 2 - .../jsr356/metadata/CoderMetadata.java | 2 - .../jsr356/metadata/CoderMetadataSet.java | 4 -- .../metadata/DuplicateCoderException.java | 2 - .../websocket/jsr356/ConfiguratorTest.java | 3 +- .../java/examples/GetHttpSessionSocket.java | 1 + .../jsr356/server/LargeAnnotatedTest.java | 4 +- .../jsr356/server/LargeContainerTest.java | 4 +- .../websocket/jsr356/server/SessionTest.java | 2 +- .../server/blockhead/BlockheadClient.java | 7 +-- .../samples/echo/LargeEchoDefaultSocket.java | 1 - .../api/InvalidWebSocketException.java | 3 - .../eclipse/jetty/websocket/api/Session.java | 2 - .../api/annotations/OnWebSocketClose.java | 2 - .../api/annotations/OnWebSocketConnect.java | 2 - .../api/annotations/OnWebSocketError.java | 2 - .../api/annotations/OnWebSocketFrame.java | 2 - .../api/annotations/OnWebSocketMessage.java | 3 - .../api/io/WebSocketBlockingConnection.java | 61 ------------------- .../api/io/WebSocketOutputStream.java | 40 ------------ .../websocket/api/io/WebSocketWriter.java | 52 ---------------- .../jetty/websocket/api/io/package-info.java | 23 ------- .../annotations/MyEchoBinarySocket.java | 3 +- .../common/annotations/MyEchoSocket.java | 12 ++-- .../message/MessageInputStreamTest.java | 21 +++---- .../common/message/Utf8CharBufferTest.java | 6 +- 46 files changed, 28 insertions(+), 273 deletions(-) delete mode 100644 jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketBlockingConnection.java delete mode 100644 jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketOutputStream.java delete mode 100644 jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketWriter.java delete mode 100644 jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/package-info.java diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/MessageHandlerWrapper.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/MessageHandlerWrapper.java index 891bde12073..83d3f94c77b 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/MessageHandlerWrapper.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/MessageHandlerWrapper.java @@ -19,8 +19,6 @@ package org.eclipse.jetty.websocket.jsr356; import javax.websocket.MessageHandler; -import javax.websocket.MessageHandler.Partial; -import javax.websocket.MessageHandler.Whole; import org.eclipse.jetty.websocket.jsr356.metadata.MessageHandlerMetadata; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/AnnotatedEndpointMetadata.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/AnnotatedEndpointMetadata.java index 776e5effb0e..d5f1461f5fb 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/AnnotatedEndpointMetadata.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/AnnotatedEndpointMetadata.java @@ -22,10 +22,6 @@ import java.lang.annotation.Annotation; import java.util.LinkedList; import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; import org.eclipse.jetty.websocket.jsr356.metadata.DecoderMetadata; import org.eclipse.jetty.websocket.jsr356.metadata.DecoderMetadataSet; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/IJsrMethod.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/IJsrMethod.java index 0e3f86b485c..5b5cc3629ae 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/IJsrMethod.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/IJsrMethod.java @@ -21,7 +21,6 @@ package org.eclipse.jetty.websocket.jsr356.annotations; import java.lang.reflect.Method; import javax.websocket.Decoder; -import javax.websocket.OnMessage; import org.eclipse.jetty.websocket.jsr356.MessageType; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrEvents.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrEvents.java index 2d0d2849170..56b879c498d 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrEvents.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrEvents.java @@ -28,10 +28,6 @@ import java.util.Map; import javax.websocket.CloseReason; import javax.websocket.DecodeException; import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; import javax.websocket.RemoteEndpoint; import org.eclipse.jetty.util.log.Log; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdBinary.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdBinary.java index ce204a3f1a9..8482ff95949 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdBinary.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdBinary.java @@ -21,8 +21,6 @@ package org.eclipse.jetty.websocket.jsr356.annotations; import java.io.InputStream; import java.nio.ByteBuffer; -import javax.websocket.OnMessage; - import org.eclipse.jetty.websocket.common.events.annotated.InvalidSignatureException; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; import org.eclipse.jetty.websocket.jsr356.decoders.ByteArrayDecoder; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdDecoder.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdDecoder.java index 8942eec6396..26c62bd3e0f 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdDecoder.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdDecoder.java @@ -18,9 +18,6 @@ package org.eclipse.jetty.websocket.jsr356.annotations; -import javax.websocket.Decoder; -import javax.websocket.OnMessage; - import org.eclipse.jetty.websocket.common.events.annotated.InvalidSignatureException; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; import org.eclipse.jetty.websocket.jsr356.metadata.DecoderMetadata; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnClose.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnClose.java index 7b271a4af1f..f6b89c5f95c 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnClose.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnClose.java @@ -19,7 +19,6 @@ package org.eclipse.jetty.websocket.jsr356.annotations; import javax.websocket.CloseReason; -import javax.websocket.OnClose; import org.eclipse.jetty.websocket.common.events.annotated.InvalidSignatureException; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnError.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnError.java index 765f7b40a76..775b3706cc7 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnError.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnError.java @@ -18,8 +18,6 @@ package org.eclipse.jetty.websocket.jsr356.annotations; -import javax.websocket.OnError; - import org.eclipse.jetty.websocket.common.events.annotated.InvalidSignatureException; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnOpen.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnOpen.java index 1340187839e..f9a0007899c 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnOpen.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdOnOpen.java @@ -19,7 +19,6 @@ package org.eclipse.jetty.websocket.jsr356.annotations; import javax.websocket.EndpointConfig; -import javax.websocket.OnOpen; import org.eclipse.jetty.websocket.common.events.annotated.InvalidSignatureException; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdText.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdText.java index d7eb8f9cb6f..f38b34a3b90 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdText.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/JsrParamIdText.java @@ -20,8 +20,6 @@ package org.eclipse.jetty.websocket.jsr356.annotations; import java.io.Reader; -import javax.websocket.OnMessage; - import org.eclipse.jetty.websocket.common.events.annotated.InvalidSignatureException; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; import org.eclipse.jetty.websocket.jsr356.decoders.BooleanDecoder; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnCloseCallable.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnCloseCallable.java index f854aaa3b0c..41cc8ba27c6 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnCloseCallable.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnCloseCallable.java @@ -23,7 +23,6 @@ import java.lang.reflect.Method; import javax.websocket.CloseReason; import javax.websocket.CloseReason.CloseCodes; import javax.websocket.Decoder; -import javax.websocket.OnClose; import org.eclipse.jetty.websocket.common.CloseInfo; import org.eclipse.jetty.websocket.jsr356.JsrSession; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnErrorCallable.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnErrorCallable.java index c9489b7b27a..1895ac9158e 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnErrorCallable.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnErrorCallable.java @@ -21,7 +21,6 @@ package org.eclipse.jetty.websocket.jsr356.annotations; import java.lang.reflect.Method; import javax.websocket.Decoder; -import javax.websocket.OnError; import org.eclipse.jetty.websocket.jsr356.JsrSession; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageBinaryCallable.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageBinaryCallable.java index 5c0c8342786..02f85596b88 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageBinaryCallable.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageBinaryCallable.java @@ -23,7 +23,6 @@ import java.nio.ByteBuffer; import javax.websocket.DecodeException; import javax.websocket.Decoder; -import javax.websocket.OnMessage; import org.eclipse.jetty.websocket.jsr356.JsrSession; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageBinaryStreamCallable.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageBinaryStreamCallable.java index 6fad4650bb4..cf00461f22c 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageBinaryStreamCallable.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageBinaryStreamCallable.java @@ -25,7 +25,6 @@ import java.lang.reflect.Method; import javax.websocket.DecodeException; import javax.websocket.Decoder; -import javax.websocket.OnMessage; import org.eclipse.jetty.websocket.jsr356.JsrSession; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessagePongCallable.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessagePongCallable.java index 8ac8656e4ba..8b14bb84891 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessagePongCallable.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessagePongCallable.java @@ -22,8 +22,6 @@ import java.lang.reflect.Method; import java.nio.ByteBuffer; import javax.websocket.DecodeException; -import javax.websocket.OnMessage; -import javax.websocket.PongMessage; import org.eclipse.jetty.websocket.jsr356.JsrPongMessage; import org.eclipse.jetty.websocket.jsr356.JsrSession; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageTextCallable.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageTextCallable.java index 441e2b1be99..b6debed9a30 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageTextCallable.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageTextCallable.java @@ -18,12 +18,10 @@ package org.eclipse.jetty.websocket.jsr356.annotations; -import java.io.Reader; import java.lang.reflect.Method; import javax.websocket.DecodeException; import javax.websocket.Decoder; -import javax.websocket.OnMessage; import org.eclipse.jetty.websocket.jsr356.JsrSession; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageTextStreamCallable.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageTextStreamCallable.java index 2dcd28dee1c..4aa70f89ea7 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageTextStreamCallable.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnMessageTextStreamCallable.java @@ -24,7 +24,6 @@ import java.lang.reflect.Method; import javax.websocket.DecodeException; import javax.websocket.Decoder; -import javax.websocket.OnMessage; import org.eclipse.jetty.websocket.jsr356.JsrSession; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnOpenCallable.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnOpenCallable.java index 388bee650ed..980f98abd7b 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnOpenCallable.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/OnOpenCallable.java @@ -22,7 +22,6 @@ import java.lang.reflect.Method; import javax.websocket.Decoder; import javax.websocket.EndpointConfig; -import javax.websocket.OnOpen; import org.eclipse.jetty.websocket.jsr356.JsrSession; import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/endpoints/JsrAnnotatedEventDriver.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/endpoints/JsrAnnotatedEventDriver.java index cc55e2e8498..5087d23c980 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/endpoints/JsrAnnotatedEventDriver.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/endpoints/JsrAnnotatedEventDriver.java @@ -26,7 +26,6 @@ import java.util.Map; import javax.websocket.CloseReason; import javax.websocket.DecodeException; -import javax.websocket.MessageHandler.Whole; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.log.Log; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/messages/BinaryPartialOnMessage.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/messages/BinaryPartialOnMessage.java index 21c60a58502..5b6e828fbde 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/messages/BinaryPartialOnMessage.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/messages/BinaryPartialOnMessage.java @@ -21,8 +21,6 @@ package org.eclipse.jetty.websocket.jsr356.messages; import java.io.IOException; import java.nio.ByteBuffer; -import javax.websocket.OnMessage; - import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.websocket.common.message.MessageAppender; import org.eclipse.jetty.websocket.jsr356.endpoints.JsrAnnotatedEventDriver; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/messages/TextPartialOnMessage.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/messages/TextPartialOnMessage.java index 12b4e7b97ed..bdef7eb99a8 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/messages/TextPartialOnMessage.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/messages/TextPartialOnMessage.java @@ -21,8 +21,6 @@ package org.eclipse.jetty.websocket.jsr356.messages; import java.io.IOException; import java.nio.ByteBuffer; -import javax.websocket.OnMessage; - import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.websocket.common.message.MessageAppender; import org.eclipse.jetty.websocket.jsr356.endpoints.JsrAnnotatedEventDriver; diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/CoderMetadata.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/CoderMetadata.java index 32b2706d8c6..40aa368f8bc 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/CoderMetadata.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/CoderMetadata.java @@ -18,8 +18,6 @@ package org.eclipse.jetty.websocket.jsr356.metadata; -import javax.websocket.Decoder; - import org.eclipse.jetty.websocket.jsr356.MessageType; /** diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/CoderMetadataSet.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/CoderMetadataSet.java index 52ce2e51139..302729e2727 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/CoderMetadataSet.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/CoderMetadataSet.java @@ -24,10 +24,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import javax.websocket.Decoder; - -import org.eclipse.jetty.websocket.api.InvalidWebSocketException; - /** * An durable collection of {@link CoderMetadata}. *

diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/DuplicateCoderException.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/DuplicateCoderException.java index 9758d49a564..dd4ace61d11 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/DuplicateCoderException.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/metadata/DuplicateCoderException.java @@ -18,8 +18,6 @@ package org.eclipse.jetty.websocket.jsr356.metadata; -import javax.websocket.Decoder; - import org.eclipse.jetty.websocket.api.InvalidWebSocketException; /** diff --git a/jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/ConfiguratorTest.java b/jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/ConfiguratorTest.java index a0f8fb37aff..66d061fb0f8 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/ConfiguratorTest.java +++ b/jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/ConfiguratorTest.java @@ -18,7 +18,7 @@ package org.eclipse.jetty.websocket.jsr356; -import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.*; import java.net.URI; import java.util.List; @@ -26,7 +26,6 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import javax.websocket.ClientEndpointConfig; -import javax.websocket.ClientEndpointConfig.Configurator; import javax.websocket.ContainerProvider; import javax.websocket.HandshakeResponse; import javax.websocket.Session; diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/examples/GetHttpSessionSocket.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/examples/GetHttpSessionSocket.java index 9873c9a6e73..3916d0ad96c 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/examples/GetHttpSessionSocket.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/examples/GetHttpSessionSocket.java @@ -31,6 +31,7 @@ import javax.websocket.server.ServerEndpoint; public class GetHttpSessionSocket { private Session wsSession; + @SuppressWarnings("unused") private HttpSession httpSession; @OnOpen diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/LargeAnnotatedTest.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/LargeAnnotatedTest.java index 8fe0fc218d6..11d32182639 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/LargeAnnotatedTest.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/LargeAnnotatedTest.java @@ -19,13 +19,13 @@ package org.eclipse.jetty.websocket.jsr356.server; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Queue; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.toolchain.test.TestingDir; -import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.client.WebSocketClient; @@ -70,7 +70,7 @@ public class LargeAnnotatedTest // The message size should be bigger than default, but smaller than the limit that LargeEchoSocket specifies byte txt[] = new byte[100 * 1024]; Arrays.fill(txt,(byte)'o'); - String msg = new String(txt,StringUtil.__UTF8_CHARSET); + String msg = new String(txt,StandardCharsets.UTF_8); clientEcho.sendMessage(msg); Queue msgs = clientEcho.awaitMessages(1); Assert.assertEquals("Expected message",msg,msgs.poll()); diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/LargeContainerTest.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/LargeContainerTest.java index fb1564dd259..3eaac235192 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/LargeContainerTest.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/LargeContainerTest.java @@ -19,13 +19,13 @@ package org.eclipse.jetty.websocket.jsr356.server; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Queue; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.toolchain.test.TestingDir; -import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.client.WebSocketClient; @@ -70,7 +70,7 @@ public class LargeContainerTest // The message size should be bigger than default, but smaller than the limit that LargeEchoSocket specifies byte txt[] = new byte[100 * 1024]; Arrays.fill(txt,(byte)'o'); - String msg = new String(txt,StringUtil.__UTF8_CHARSET); + String msg = new String(txt,StandardCharsets.UTF_8); clientEcho.sendMessage(msg); Queue msgs = clientEcho.awaitMessages(1); Assert.assertEquals("Expected message",msg,msgs.poll()); diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/SessionTest.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/SessionTest.java index dbda210d8dc..6a9acbb9c15 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/SessionTest.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/SessionTest.java @@ -18,7 +18,7 @@ package org.eclipse.jetty.websocket.jsr356.server; -import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.*; import java.net.URI; import java.util.ArrayList; diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/blockhead/BlockheadClient.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/blockhead/BlockheadClient.java index 7f376db94f3..080cd02b71c 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/blockhead/BlockheadClient.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/blockhead/BlockheadClient.java @@ -18,16 +18,13 @@ package org.eclipse.jetty.websocket.jsr356.server.blockhead; -import static org.hamcrest.Matchers.anyOf; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.*; import java.io.Closeable; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.HttpURLConnection; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; @@ -43,8 +40,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; -import javax.net.ssl.HttpsURLConnection; - import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.MappedByteBufferPool; import org.eclipse.jetty.util.BufferUtil; diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/echo/LargeEchoDefaultSocket.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/echo/LargeEchoDefaultSocket.java index 851a1ac2bbf..e5c378972f4 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/echo/LargeEchoDefaultSocket.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/echo/LargeEchoDefaultSocket.java @@ -20,7 +20,6 @@ package org.eclipse.jetty.websocket.jsr356.server.samples.echo; import javax.websocket.OnMessage; import javax.websocket.Session; -import javax.websocket.WebSocketContainer; import javax.websocket.server.ServerEndpoint; /** diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/InvalidWebSocketException.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/InvalidWebSocketException.java index b3de699a50d..3ffe7f124df 100644 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/InvalidWebSocketException.java +++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/InvalidWebSocketException.java @@ -18,9 +18,6 @@ package org.eclipse.jetty.websocket.api; -import org.eclipse.jetty.websocket.api.annotations.WebSocket; - - /** * Indicating that the provided Class is not a valid WebSocket as defined by the API. *

diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/Session.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/Session.java index 28b3b779860..fdc03086c7e 100644 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/Session.java +++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/Session.java @@ -22,8 +22,6 @@ import java.io.Closeable; import java.io.IOException; import java.net.InetSocketAddress; -import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; - /** * Session represents an active link of communications with a Remote WebSocket Endpoint. *

diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketClose.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketClose.java index cd348b9a090..285cbd19c5c 100644 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketClose.java +++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketClose.java @@ -24,8 +24,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.eclipse.jetty.websocket.api.Session; - /** * Annotation for tagging methods to receive connection close events. *

diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketConnect.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketConnect.java index f9e427e0d56..d35640da096 100644 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketConnect.java +++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketConnect.java @@ -24,8 +24,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.eclipse.jetty.websocket.api.Session; - /** * Annotation for tagging methods to receive connection open events. *

diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketError.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketError.java index 452ab922d76..89afe368477 100644 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketError.java +++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketError.java @@ -24,8 +24,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.eclipse.jetty.websocket.api.Session; - /** * Annotation for receiving websocket errors (exceptions) that have occurred internally in the websocket implementation. *

diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketFrame.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketFrame.java index 959cebd0c6e..f12e8a135d7 100644 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketFrame.java +++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketFrame.java @@ -24,8 +24,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.eclipse.jetty.websocket.api.Session; - /** * (ADVANCED) Annotation for tagging methods to receive frame events. *

diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketMessage.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketMessage.java index 9d628770557..e26b277e1c6 100644 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketMessage.java +++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/annotations/OnWebSocketMessage.java @@ -18,15 +18,12 @@ package org.eclipse.jetty.websocket.api.annotations; -import java.io.Reader; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.eclipse.jetty.websocket.api.Session; - /** * Annotation for tagging methods to receive Binary or Text Message events. *

diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketBlockingConnection.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketBlockingConnection.java deleted file mode 100644 index 69c36a0a5a9..00000000000 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketBlockingConnection.java +++ /dev/null @@ -1,61 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// 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.eclipse.jetty.websocket.api.io; - -import java.io.IOException; -import java.nio.ByteBuffer; - -import org.eclipse.jetty.websocket.api.RemoteEndpoint; -import org.eclipse.jetty.websocket.api.Session; - -/** - * For working with the {@link Session} in a blocking technique. - *

- * This is an end-user accessible class. - */ -public class WebSocketBlockingConnection -{ - private final RemoteEndpoint remote; - - public WebSocketBlockingConnection(Session session) - { - this.remote = session.getRemote(); - } - - /** - * Send a binary message. - *

- * Basic usage, results in a blocking write. - */ - public void write(byte[] data, int offset, int length) throws IOException - { - ByteBuffer buf = ByteBuffer.wrap(data,offset,length); - remote.sendBytes(buf); - } - - /** - * Send text message. - *

- * Basic usage, results in a blocking write. - */ - public void write(String message) throws IOException - { - remote.sendString(message); - } -} diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketOutputStream.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketOutputStream.java deleted file mode 100644 index 42699bdb61d..00000000000 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketOutputStream.java +++ /dev/null @@ -1,40 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// 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.eclipse.jetty.websocket.api.io; - -import java.io.IOException; -import java.io.OutputStream; - -import org.eclipse.jetty.websocket.api.Session; - -public class WebSocketOutputStream extends OutputStream -{ - private final Session session; - - public WebSocketOutputStream(Session session) - { - this.session = session; - } - - @Override - public void write(int b) throws IOException - { - // TODO Auto-generated method stub - } -} diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketWriter.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketWriter.java deleted file mode 100644 index 43db5aaee6d..00000000000 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/WebSocketWriter.java +++ /dev/null @@ -1,52 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// 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.eclipse.jetty.websocket.api.io; - -import java.io.IOException; -import java.io.Writer; - -import org.eclipse.jetty.websocket.api.Session; - -public class WebSocketWriter extends Writer -{ - private final Session session; - - public WebSocketWriter(Session session) - { - this.session = session; - } - - @Override - public void close() throws IOException - { - // TODO Auto-generated method stub - } - - @Override - public void flush() throws IOException - { - // TODO Auto-generated method stub - } - - @Override - public void write(char[] cbuf, int off, int len) throws IOException - { - // TODO Auto-generated method stub - } -} diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/package-info.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/package-info.java deleted file mode 100644 index 6c2ae1c2974..00000000000 --- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/io/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// 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. -// ======================================================================== -// - -/** - * Jetty WebSocket API : I/O Classes - */ -package org.eclipse.jetty.websocket.api.io; - diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/MyEchoBinarySocket.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/MyEchoBinarySocket.java index a65d78289d7..bd1669b9f3e 100644 --- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/MyEchoBinarySocket.java +++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/MyEchoBinarySocket.java @@ -19,6 +19,7 @@ package org.eclipse.jetty.websocket.common.annotations; import java.io.IOException; +import java.nio.ByteBuffer; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; import org.eclipse.jetty.websocket.api.annotations.WebSocket; @@ -34,7 +35,7 @@ public class MyEchoBinarySocket extends MyEchoSocket { try { - getConnection().write(buf,offset,length); + getRemote().sendBytes(ByteBuffer.wrap(buf,offset,length)); } catch (IOException e) { diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/MyEchoSocket.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/MyEchoSocket.java index 7c8205ac639..7ac7ce7bde2 100644 --- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/MyEchoSocket.java +++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/MyEchoSocket.java @@ -20,12 +20,12 @@ package org.eclipse.jetty.websocket.common.annotations; import java.io.IOException; +import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; import org.eclipse.jetty.websocket.api.annotations.WebSocket; -import org.eclipse.jetty.websocket.api.io.WebSocketBlockingConnection; /** * The most common websocket implementation. @@ -36,11 +36,11 @@ import org.eclipse.jetty.websocket.api.io.WebSocketBlockingConnection; public class MyEchoSocket { private Session session; - private WebSocketBlockingConnection blocking; + private RemoteEndpoint remote; - public WebSocketBlockingConnection getConnection() + public RemoteEndpoint getRemote() { - return blocking; + return remote; } @OnWebSocketClose @@ -53,7 +53,7 @@ public class MyEchoSocket public void onConnect(Session session) { this.session = session; - this.blocking = new WebSocketBlockingConnection(session); + this.remote = session.getRemote(); } @OnWebSocketMessage @@ -68,7 +68,7 @@ public class MyEchoSocket try { - blocking.write(message); + remote.sendString(message); } catch (IOException e) { diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageInputStreamTest.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageInputStreamTest.java index dd35791b070..4e4f2e7c493 100644 --- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageInputStreamTest.java +++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageInputStreamTest.java @@ -18,17 +18,16 @@ package org.eclipse.jetty.websocket.common.message; -import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.*; import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.websocket.common.io.LocalWebSocketConnection; import org.junit.Assert; import org.junit.Rule; @@ -37,8 +36,6 @@ import org.junit.rules.TestName; public class MessageInputStreamTest { - private static final Charset UTF8 = StringUtil.__UTF8_CHARSET; - @Rule public TestName testname = new TestName(); @@ -50,7 +47,7 @@ public class MessageInputStreamTest try (MessageInputStream stream = new MessageInputStream(conn)) { // Append a single message (simple, short) - ByteBuffer payload = BufferUtil.toBuffer("Hello World",UTF8); + ByteBuffer payload = BufferUtil.toBuffer("Hello World",StandardCharsets.UTF_8); System.out.printf("payload = %s%n",BufferUtil.toDetailString(payload)); boolean fin = true; stream.appendMessage(payload,fin); @@ -58,7 +55,7 @@ public class MessageInputStreamTest // Read entire message it from the stream. byte buf[] = new byte[32]; int len = stream.read(buf); - String message = new String(buf,0,len,UTF8); + String message = new String(buf,0,len,StandardCharsets.UTF_8); // Test it Assert.assertThat("Message",message,is("Hello World")); @@ -87,12 +84,12 @@ public class MessageInputStreamTest startLatch.countDown(); boolean fin = false; TimeUnit.MILLISECONDS.sleep(200); - stream.appendMessage(BufferUtil.toBuffer("Saved",UTF8),fin); + stream.appendMessage(BufferUtil.toBuffer("Saved",StandardCharsets.UTF_8),fin); TimeUnit.MILLISECONDS.sleep(200); - stream.appendMessage(BufferUtil.toBuffer(" by ",UTF8),fin); + stream.appendMessage(BufferUtil.toBuffer(" by ",StandardCharsets.UTF_8),fin); fin = true; TimeUnit.MILLISECONDS.sleep(200); - stream.appendMessage(BufferUtil.toBuffer("Zero",UTF8),fin); + stream.appendMessage(BufferUtil.toBuffer("Zero",StandardCharsets.UTF_8),fin); } catch (IOException | InterruptedException e) { @@ -108,7 +105,7 @@ public class MessageInputStreamTest // Read it from the stream. byte buf[] = new byte[32]; int len = stream.read(buf); - String message = new String(buf,0,len,UTF8); + String message = new String(buf,0,len,StandardCharsets.UTF_8); // Test it Assert.assertThat("Error when appending",hadError.get(),is(false)); @@ -135,7 +132,7 @@ public class MessageInputStreamTest boolean fin = true; // wait for a little bit before populating buffers TimeUnit.MILLISECONDS.sleep(400); - stream.appendMessage(BufferUtil.toBuffer("I will conquer",UTF8),fin); + stream.appendMessage(BufferUtil.toBuffer("I will conquer",StandardCharsets.UTF_8),fin); } catch (IOException | InterruptedException e) { diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/Utf8CharBufferTest.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/Utf8CharBufferTest.java index 7d19123abac..4d5a67d4862 100644 --- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/Utf8CharBufferTest.java +++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/Utf8CharBufferTest.java @@ -18,12 +18,12 @@ package org.eclipse.jetty.websocket.common.message; -import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.*; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import org.eclipse.jetty.util.BufferUtil; -import org.eclipse.jetty.util.StringUtil; import org.junit.Assert; import org.junit.Test; @@ -36,7 +36,7 @@ public class Utf8CharBufferTest private static byte[] asUTF(String str) { - return str.getBytes(StringUtil.__UTF8_CHARSET); + return str.getBytes(StandardCharsets.UTF_8); } @Test