From a0626adad5075e133a6479382f80f0a453a080a0 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 12 Mar 2020 16:21:07 +1100 Subject: [PATCH 1/2] javax websocket modules should not transitively export websocket-core Signed-off-by: Lachlan Roberts --- .../src/main/java/module-info.java | 6 +++--- .../JavaxWebSocketClientContainerProvider.java | 1 + .../AnnotatedClientEndpointConfig.java | 2 +- .../{ => internal}/BasicClientEndpointConfig.java | 2 +- .../client/{ => internal}/EmptyConfigurator.java | 2 +- .../{ => internal}/JavaxClientUpgradeRequest.java | 2 +- .../JavaxWebSocketClientContainer.java | 2 +- .../JavaxWebSocketClientFrameHandlerFactory.java | 2 +- .../client/{ => internal}/JsrUpgradeListener.java | 2 +- .../java/examples/SecureClientContainerExample.java | 2 +- .../common/JavaxWebSocketFrameHandlerFactory.java | 13 ++----------- .../src/main/java/module-info.java | 1 + .../internal/JavaxWebSocketServerContainer.java | 2 +- .../JavaxWebSocketServerFrameHandlerFactory.java | 2 +- .../websocket/javax/tests/JavaxOnCloseTest.java | 2 +- .../javax/tests/autobahn/JavaxAutobahnClient.java | 2 +- .../tests/client/AbstractClientSessionTest.java | 4 ++-- .../websocket/javax/tests/client/OnCloseTest.java | 4 ++-- .../tests/client/SessionAddMessageHandlerTest.java | 6 +++--- .../javax/tests/client/WriteTimeoutTest.java | 2 +- .../javax/tests/coders/AvailableDecodersTest.java | 2 +- .../javax/tests/coders/AvailableEncodersTest.java | 2 +- ...bstractJavaxWebSocketServerFrameHandlerTest.java | 2 +- .../javax/tests/server/SessionTrackingTest.java | 2 +- 24 files changed, 31 insertions(+), 38 deletions(-) rename jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/{ => internal}/AnnotatedClientEndpointConfig.java (97%) rename jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/{ => internal}/BasicClientEndpointConfig.java (94%) rename jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/{ => internal}/EmptyConfigurator.java (95%) rename jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/{ => internal}/JavaxClientUpgradeRequest.java (97%) rename jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/{ => internal}/JavaxWebSocketClientContainer.java (99%) rename jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/{ => internal}/JavaxWebSocketClientFrameHandlerFactory.java (97%) rename jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/{ => internal}/JsrUpgradeListener.java (97%) diff --git a/jetty-websocket/websocket-javax-client/src/main/java/module-info.java b/jetty-websocket/websocket-javax-client/src/main/java/module-info.java index c3e34017719..eb58cdef38e 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/module-info.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/module-info.java @@ -23,11 +23,11 @@ import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainerPro module org.eclipse.jetty.websocket.javax.client { exports org.eclipse.jetty.websocket.javax.client; + exports org.eclipse.jetty.websocket.javax.client.internal to org.eclipse.jetty.websocket.javax.server; + requires transitive jetty.websocket.api; requires transitive org.eclipse.jetty.client; - requires transitive org.eclipse.jetty.websocket.javax.common; - requires org.eclipse.jetty.websocket.core; - requires org.eclipse.jetty.websocket.util; + requires org.eclipse.jetty.websocket.javax.common; provides ContainerProvider with JavaxWebSocketClientContainerProvider; } diff --git a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientContainerProvider.java b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientContainerProvider.java index e8557ce63b8..6e619ce2f81 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientContainerProvider.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientContainerProvider.java @@ -23,6 +23,7 @@ import javax.websocket.WebSocketContainer; import org.eclipse.jetty.util.component.LifeCycle; import org.eclipse.jetty.util.thread.ShutdownThread; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; /** * Client {@link ContainerProvider} implementation. diff --git a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/AnnotatedClientEndpointConfig.java b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/AnnotatedClientEndpointConfig.java similarity index 97% rename from jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/AnnotatedClientEndpointConfig.java rename to jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/AnnotatedClientEndpointConfig.java index fc91b3c413f..6a207d9223c 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/AnnotatedClientEndpointConfig.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/AnnotatedClientEndpointConfig.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.javax.client; +package org.eclipse.jetty.websocket.javax.client.internal; import java.util.Collections; import java.util.List; diff --git a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/BasicClientEndpointConfig.java b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/BasicClientEndpointConfig.java similarity index 94% rename from jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/BasicClientEndpointConfig.java rename to jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/BasicClientEndpointConfig.java index 1f250b43490..21456f05e3f 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/BasicClientEndpointConfig.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/BasicClientEndpointConfig.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.javax.client; +package org.eclipse.jetty.websocket.javax.client.internal; import org.eclipse.jetty.websocket.javax.common.ClientEndpointConfigWrapper; diff --git a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/EmptyConfigurator.java b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/EmptyConfigurator.java similarity index 95% rename from jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/EmptyConfigurator.java rename to jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/EmptyConfigurator.java index 7dc21b784c8..c05d66796b8 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/EmptyConfigurator.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/EmptyConfigurator.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.javax.client; +package org.eclipse.jetty.websocket.javax.client.internal; import java.util.List; import java.util.Map; diff --git a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxClientUpgradeRequest.java b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxClientUpgradeRequest.java similarity index 97% rename from jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxClientUpgradeRequest.java rename to jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxClientUpgradeRequest.java index 5541724164b..b2fd4d5ae52 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxClientUpgradeRequest.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxClientUpgradeRequest.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.javax.client; +package org.eclipse.jetty.websocket.javax.client.internal; import java.net.URI; import java.security.Principal; diff --git a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientContainer.java b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxWebSocketClientContainer.java similarity index 99% rename from jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientContainer.java rename to jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxWebSocketClientContainer.java index fe36d8dedd1..bdf93ba6dcd 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientContainer.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxWebSocketClientContainer.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.javax.client; +package org.eclipse.jetty.websocket.javax.client.internal; import java.io.IOException; import java.net.URI; diff --git a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientFrameHandlerFactory.java b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxWebSocketClientFrameHandlerFactory.java similarity index 97% rename from jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientFrameHandlerFactory.java rename to jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxWebSocketClientFrameHandlerFactory.java index 3eac9cb84fc..39f3221b877 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JavaxWebSocketClientFrameHandlerFactory.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JavaxWebSocketClientFrameHandlerFactory.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.javax.client; +package org.eclipse.jetty.websocket.javax.client.internal; import javax.websocket.ClientEndpoint; import javax.websocket.Endpoint; diff --git a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JsrUpgradeListener.java b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JsrUpgradeListener.java similarity index 97% rename from jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JsrUpgradeListener.java rename to jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JsrUpgradeListener.java index f605a7ddcca..8ce0df47cdb 100644 --- a/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/JsrUpgradeListener.java +++ b/jetty-websocket/websocket-javax-client/src/main/java/org/eclipse/jetty/websocket/javax/client/internal/JsrUpgradeListener.java @@ -16,7 +16,7 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.javax.client; +package org.eclipse.jetty.websocket.javax.client.internal; import java.util.ArrayList; import java.util.HashMap; diff --git a/jetty-websocket/websocket-javax-client/src/test/java/examples/SecureClientContainerExample.java b/jetty-websocket/websocket-javax-client/src/test/java/examples/SecureClientContainerExample.java index 34aea9140cd..b41d66e1336 100644 --- a/jetty-websocket/websocket-javax-client/src/test/java/examples/SecureClientContainerExample.java +++ b/jetty-websocket/websocket-javax-client/src/test/java/examples/SecureClientContainerExample.java @@ -28,7 +28,7 @@ import org.eclipse.jetty.client.http.HttpClientTransportOverHTTP; import org.eclipse.jetty.io.ClientConnector; import org.eclipse.jetty.util.component.LifeCycle; import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; public class SecureClientContainerExample { diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java index f32209acf9c..00f25667e77 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java @@ -704,18 +704,9 @@ public abstract class JavaxWebSocketFrameHandlerFactory } } - private MethodHandles.Lookup getMethodHandleLookup(Class endpointClass) throws InvalidWebSocketException + private MethodHandles.Lookup getMethodHandleLookup(Class endpointClass) { - MethodHandles.Lookup lookup; - try - { - lookup = MethodHandles.privateLookupIn(endpointClass, MethodHandles.lookup()); - } - catch (IllegalAccessException e) - { - throw new InvalidWebSocketException("Unable to obtain MethodHandle lookup for " + endpointClass, e); - } - return lookup; + return MethodHandles.lookup(); } private static class DecodedArgs diff --git a/jetty-websocket/websocket-javax-server/src/main/java/module-info.java b/jetty-websocket/websocket-javax-server/src/main/java/module-info.java index 5f22863fa27..cdd1b15dd38 100644 --- a/jetty-websocket/websocket-javax-server/src/main/java/module-info.java +++ b/jetty-websocket/websocket-javax-server/src/main/java/module-info.java @@ -30,6 +30,7 @@ module org.eclipse.jetty.websocket.javax.server requires transitive org.eclipse.jetty.webapp; requires transitive org.eclipse.jetty.websocket.javax.client; + requires org.eclipse.jetty.websocket.javax.common; requires org.eclipse.jetty.websocket.servlet; provides ServletContainerInitializer with JavaxWebSocketServletContainerInitializer; diff --git a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java index 0c84a4ab83d..d907ee1669b 100644 --- a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java +++ b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java @@ -39,7 +39,7 @@ import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient; import org.eclipse.jetty.websocket.core.exception.WebSocketException; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; import org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketServletContainerInitializer; import org.eclipse.jetty.websocket.servlet.WebSocketMapping; diff --git a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerFrameHandlerFactory.java b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerFrameHandlerFactory.java index e070107ac44..a31ea1741e6 100644 --- a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerFrameHandlerFactory.java +++ b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerFrameHandlerFactory.java @@ -24,7 +24,7 @@ import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.http.pathmap.UriTemplatePathSpec; import org.eclipse.jetty.websocket.core.FrameHandler; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientFrameHandlerFactory; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientFrameHandlerFactory; import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketContainer; import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketFrameHandlerMetadata; import org.eclipse.jetty.websocket.servlet.FrameHandlerFactory; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/JavaxOnCloseTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/JavaxOnCloseTest.java index 100bd9cad87..138266304c8 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/JavaxOnCloseTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/JavaxOnCloseTest.java @@ -34,7 +34,7 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.BlockingArrayQueue; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; import org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketServletContainerInitializer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnClient.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnClient.java index 278eb591863..abfada4a254 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnClient.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/autobahn/JavaxAutobahnClient.java @@ -27,7 +27,7 @@ import org.eclipse.jetty.util.UrlEncoded; import org.eclipse.jetty.util.component.LifeCycle; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; import org.eclipse.jetty.websocket.javax.tests.EventSocket; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/AbstractClientSessionTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/AbstractClientSessionTest.java index 18ccbc08041..1c94084f950 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/AbstractClientSessionTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/AbstractClientSessionTest.java @@ -19,8 +19,8 @@ package org.eclipse.jetty.websocket.javax.tests.client; import org.eclipse.jetty.websocket.core.CoreSession; -import org.eclipse.jetty.websocket.javax.client.BasicClientEndpointConfig; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; +import org.eclipse.jetty.websocket.javax.client.internal.BasicClientEndpointConfig; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketContainer; import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketFrameHandler; import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketSession; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/OnCloseTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/OnCloseTest.java index c23e5362e76..7c9ca2e19b8 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/OnCloseTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/OnCloseTest.java @@ -27,8 +27,8 @@ import javax.websocket.ClientEndpointConfig; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.CoreSession; -import org.eclipse.jetty.websocket.javax.client.BasicClientEndpointConfig; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; +import org.eclipse.jetty.websocket.javax.client.internal.BasicClientEndpointConfig; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketFrameHandler; import org.eclipse.jetty.websocket.javax.common.UpgradeRequest; import org.eclipse.jetty.websocket.javax.common.UpgradeRequestAdapter; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/SessionAddMessageHandlerTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/SessionAddMessageHandlerTest.java index 129a491bdb8..f980f1cd3e6 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/SessionAddMessageHandlerTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/SessionAddMessageHandlerTest.java @@ -30,9 +30,9 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.websocket.core.CoreSession; import org.eclipse.jetty.websocket.core.Frame; import org.eclipse.jetty.websocket.core.OpCode; -import org.eclipse.jetty.websocket.javax.client.BasicClientEndpointConfig; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientFrameHandlerFactory; +import org.eclipse.jetty.websocket.javax.client.internal.BasicClientEndpointConfig; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientFrameHandlerFactory; import org.eclipse.jetty.websocket.javax.common.ConfiguredEndpoint; import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketFrameHandler; import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketFrameHandlerFactory; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/WriteTimeoutTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/WriteTimeoutTest.java index 17df21ec936..ca53d60dd66 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/WriteTimeoutTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/WriteTimeoutTest.java @@ -24,7 +24,7 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.websocket.core.exception.WebSocketWriteTimeoutException; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; import org.eclipse.jetty.websocket.javax.common.JavaxWebSocketContainer; import org.eclipse.jetty.websocket.javax.tests.EventSocket; import org.eclipse.jetty.websocket.javax.tests.LocalServer; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableDecodersTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableDecodersTest.java index a5a93916345..ff8050c6bbf 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableDecodersTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableDecodersTest.java @@ -28,7 +28,7 @@ import javax.websocket.Decoder; import javax.websocket.EndpointConfig; import org.eclipse.jetty.toolchain.test.Hex; -import org.eclipse.jetty.websocket.javax.client.BasicClientEndpointConfig; +import org.eclipse.jetty.websocket.javax.client.internal.BasicClientEndpointConfig; import org.eclipse.jetty.websocket.javax.common.decoders.AvailableDecoders; import org.eclipse.jetty.websocket.javax.common.decoders.IntegerDecoder; import org.eclipse.jetty.websocket.util.InvalidWebSocketException; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableEncodersTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableEncodersTest.java index e49e2f7912f..acde049e045 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableEncodersTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableEncodersTest.java @@ -30,7 +30,7 @@ import javax.websocket.Encoder; import javax.websocket.EndpointConfig; import org.eclipse.jetty.toolchain.test.Hex; -import org.eclipse.jetty.websocket.javax.client.BasicClientEndpointConfig; +import org.eclipse.jetty.websocket.javax.client.internal.BasicClientEndpointConfig; import org.eclipse.jetty.websocket.javax.common.encoders.AvailableEncoders; import org.eclipse.jetty.websocket.javax.common.encoders.IntegerEncoder; import org.eclipse.jetty.websocket.util.InvalidWebSocketException; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/AbstractJavaxWebSocketServerFrameHandlerTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/AbstractJavaxWebSocketServerFrameHandlerTest.java index 571191f5458..9a2f5f1f314 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/AbstractJavaxWebSocketServerFrameHandlerTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/AbstractJavaxWebSocketServerFrameHandlerTest.java @@ -24,7 +24,7 @@ import javax.websocket.EndpointConfig; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.websocket.javax.client.BasicClientEndpointConfig; +import org.eclipse.jetty.websocket.javax.client.internal.BasicClientEndpointConfig; import org.eclipse.jetty.websocket.javax.common.decoders.AvailableDecoders; import org.eclipse.jetty.websocket.javax.common.encoders.AvailableEncoders; import org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketServletContainerInitializer; diff --git a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java index 2e78d05929b..7a660cc421a 100644 --- a/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java +++ b/jetty-websocket/websocket-javax-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java @@ -27,7 +27,7 @@ import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.eclipse.jetty.util.BlockingArrayQueue; -import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer; +import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer; import org.eclipse.jetty.websocket.javax.tests.EventSocket; import org.eclipse.jetty.websocket.javax.tests.LocalServer; import org.junit.jupiter.api.AfterAll; From ac69c53077b3f5f6b655b2a0dd438a2786951ee1 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 12 Mar 2020 18:22:26 +1100 Subject: [PATCH 2/2] jetty websocket modules should not transitively export websocket-core Signed-off-by: Lachlan Roberts --- .../common/JavaxWebSocketFrameHandlerFactory.java | 13 +++++++++++-- .../jetty/websocket/api}/WebSocketContainer.java | 5 +---- .../src/main/java/module-info.java | 3 ++- .../jetty/websocket/client/WebSocketClient.java | 9 ++------- .../client/impl/JettyClientUpgradeRequest.java | 12 +++++------- .../src/main/java/module-info.java | 2 +- .../common/JettyWebSocketFrameHandler.java | 1 + .../common/JettyWebSocketFrameHandlerFactory.java | 1 + .../jetty/websocket/common/DummyContainer.java | 1 + .../src/main/java/module-info.java | 3 ++- .../server/JettyWebSocketServerContainer.java | 2 +- .../internal/JettyServerFrameHandlerFactory.java | 2 +- .../websocket/tests/server/ContainerEndpoint.java | 2 +- .../websocket/tests/server/ServerCloseCreator.java | 2 +- 14 files changed, 31 insertions(+), 27 deletions(-) rename jetty-websocket/{websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common => websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api}/WebSocketContainer.java (92%) diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java index 00f25667e77..f32209acf9c 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandlerFactory.java @@ -704,9 +704,18 @@ public abstract class JavaxWebSocketFrameHandlerFactory } } - private MethodHandles.Lookup getMethodHandleLookup(Class endpointClass) + private MethodHandles.Lookup getMethodHandleLookup(Class endpointClass) throws InvalidWebSocketException { - return MethodHandles.lookup(); + MethodHandles.Lookup lookup; + try + { + lookup = MethodHandles.privateLookupIn(endpointClass, MethodHandles.lookup()); + } + catch (IllegalAccessException e) + { + throw new InvalidWebSocketException("Unable to obtain MethodHandle lookup for " + endpointClass, e); + } + return lookup; } private static class DecodedArgs diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketContainer.java b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketContainer.java similarity index 92% rename from jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketContainer.java rename to jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketContainer.java index 0fda005d55e..0c32ce6b5f8 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketContainer.java +++ b/jetty-websocket/websocket-jetty-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketContainer.java @@ -16,15 +16,12 @@ // ======================================================================== // -package org.eclipse.jetty.websocket.common; +package org.eclipse.jetty.websocket.api; import java.util.Collection; import java.util.concurrent.Executor; import java.util.function.Consumer; -import org.eclipse.jetty.websocket.api.Session; -import org.eclipse.jetty.websocket.api.WebSocketSessionListener; - /** * Generic interface to the Container (server or client) */ diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java index 5285a8ab1bc..21bf522de9d 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java @@ -21,6 +21,7 @@ module org.eclipse.jetty.websocket.jetty.client exports org.eclipse.jetty.websocket.client; requires transitive org.eclipse.jetty.client; + requires transitive org.eclipse.jetty.websocket.jetty.api; requires org.eclipse.jetty.websocket.core; - requires transitive org.eclipse.jetty.websocket.jetty.common; + requires org.eclipse.jetty.websocket.jetty.common; } diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java index 80cccfffb36..a83d4a93732 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java @@ -45,13 +45,13 @@ import org.eclipse.jetty.util.thread.ShutdownThread; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.UpgradeRequest; import org.eclipse.jetty.websocket.api.WebSocketBehavior; +import org.eclipse.jetty.websocket.api.WebSocketContainer; import org.eclipse.jetty.websocket.api.WebSocketPolicy; import org.eclipse.jetty.websocket.api.WebSocketSessionListener; import org.eclipse.jetty.websocket.client.impl.JettyClientUpgradeRequest; import org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler; import org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory; import org.eclipse.jetty.websocket.common.SessionTracker; -import org.eclipse.jetty.websocket.common.WebSocketContainer; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.client.UpgradeListener; @@ -131,7 +131,7 @@ public class WebSocketClient extends ContainerLifeCycle implements WebSocketPoli coreClient.addBean(listener); } - JettyClientUpgradeRequest upgradeRequest = new JettyClientUpgradeRequest(this, coreClient, request, toUri, websocket); + JettyClientUpgradeRequest upgradeRequest = new JettyClientUpgradeRequest(coreClient, request, toUri, frameHandlerFactory, websocket); if (upgradeListener != null) { upgradeRequest.addListener(new UpgradeListener() @@ -353,11 +353,6 @@ public class WebSocketClient extends ContainerLifeCycle implements WebSocketPoli return sessionTracker.getSessions(); } - public JettyWebSocketFrameHandler newFrameHandler(Object websocketPojo) - { - return frameHandlerFactory.newJettyFrameHandler(websocketPojo); - } - /** * @return the {@link SslContextFactory} that manages TLS encryption */ diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/JettyClientUpgradeRequest.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/JettyClientUpgradeRequest.java index 8a06dd88f77..85ab93c0851 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/JettyClientUpgradeRequest.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/JettyClientUpgradeRequest.java @@ -29,8 +29,8 @@ import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.websocket.api.UpgradeRequest; -import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler; +import org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory; import org.eclipse.jetty.websocket.core.ExtensionConfig; import org.eclipse.jetty.websocket.core.FrameHandler; import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest; @@ -38,21 +38,19 @@ import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient; public class JettyClientUpgradeRequest extends ClientUpgradeRequest { - private final WebSocketClient containerContext; private final DelegatedJettyClientUpgradeRequest handshakeRequest; private final JettyWebSocketFrameHandler frameHandler; - public JettyClientUpgradeRequest(WebSocketClient clientContainer, WebSocketCoreClient coreClient, UpgradeRequest request, - URI requestURI, Object websocketPojo) + public JettyClientUpgradeRequest(WebSocketCoreClient coreClient, UpgradeRequest request, URI requestURI, JettyWebSocketFrameHandlerFactory frameHandlerFactory, + Object websocketPojo) { super(coreClient, requestURI); - this.containerContext = clientContainer; if (request != null) { // Copy request details into actual request HttpFields fields = getHeaders(); - request.getHeaders().forEach((name, values) -> fields.put(name, values)); + request.getHeaders().forEach(fields::put); // Copy manually created Cookies into place List cookies = request.getCookies(); @@ -84,7 +82,7 @@ public class JettyClientUpgradeRequest extends ClientUpgradeRequest } handshakeRequest = new DelegatedJettyClientUpgradeRequest(this); - frameHandler = containerContext.newFrameHandler(websocketPojo); + frameHandler = frameHandlerFactory.newJettyFrameHandler(websocketPojo); } @Override diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java index b8ecb8308b0..d00d9c4eb91 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java @@ -24,8 +24,8 @@ module org.eclipse.jetty.websocket.jetty.common exports org.eclipse.jetty.websocket.common; requires transitive org.eclipse.jetty.websocket.core; - requires transitive org.eclipse.jetty.websocket.util; requires transitive org.eclipse.jetty.websocket.jetty.api; + requires transitive org.eclipse.jetty.websocket.util; provides ExtensionConfig.Parser with ExtensionConfigParser; } diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java index 9f8548f176e..4204837982f 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java @@ -31,6 +31,7 @@ import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.BatchMode; import org.eclipse.jetty.websocket.api.UpgradeRequest; import org.eclipse.jetty.websocket.api.UpgradeResponse; +import org.eclipse.jetty.websocket.api.WebSocketContainer; import org.eclipse.jetty.websocket.api.WriteCallback; import org.eclipse.jetty.websocket.core.CloseStatus; import org.eclipse.jetty.websocket.core.Configuration; diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerFactory.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerFactory.java index f30ea756870..5482da3b4b0 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerFactory.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandlerFactory.java @@ -39,6 +39,7 @@ import org.eclipse.jetty.websocket.api.BatchMode; import org.eclipse.jetty.websocket.api.Frame; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketConnectionListener; +import org.eclipse.jetty.websocket.api.WebSocketContainer; import org.eclipse.jetty.websocket.api.WebSocketFrameListener; import org.eclipse.jetty.websocket.api.WebSocketListener; import org.eclipse.jetty.websocket.api.WebSocketPartialListener; diff --git a/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/DummyContainer.java b/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/DummyContainer.java index 2fed76b753f..1399ba0daf8 100644 --- a/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/DummyContainer.java +++ b/jetty-websocket/websocket-jetty-common/src/test/java/org/eclipse/jetty/websocket/common/DummyContainer.java @@ -27,6 +27,7 @@ import java.util.function.Consumer; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.websocket.api.Session; +import org.eclipse.jetty.websocket.api.WebSocketContainer; import org.eclipse.jetty.websocket.api.WebSocketSessionListener; public class DummyContainer extends ContainerLifeCycle implements WebSocketContainer diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-server/src/main/java/module-info.java index 74b6da4183c..1b1e7e93922 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/module-info.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/module-info.java @@ -28,8 +28,9 @@ module org.eclipse.jetty.websocket.jetty.server exports org.eclipse.jetty.websocket.server.config; requires jetty.servlet.api; + requires org.eclipse.jetty.websocket.jetty.common; requires transitive org.eclipse.jetty.webapp; - requires transitive org.eclipse.jetty.websocket.jetty.common; + requires transitive org.eclipse.jetty.websocket.jetty.api; requires transitive org.eclipse.jetty.websocket.servlet; // Only required if using JMX. diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java index c9da57fff82..b23cef7d549 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java @@ -34,10 +34,10 @@ import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketBehavior; +import org.eclipse.jetty.websocket.api.WebSocketContainer; import org.eclipse.jetty.websocket.api.WebSocketPolicy; import org.eclipse.jetty.websocket.api.WebSocketSessionListener; import org.eclipse.jetty.websocket.common.SessionTracker; -import org.eclipse.jetty.websocket.common.WebSocketContainer; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.exception.WebSocketException; diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/JettyServerFrameHandlerFactory.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/JettyServerFrameHandlerFactory.java index 5fb1227534b..6c3acd2ea91 100644 --- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/JettyServerFrameHandlerFactory.java +++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/internal/JettyServerFrameHandlerFactory.java @@ -23,9 +23,9 @@ import javax.servlet.ServletContext; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.component.LifeCycle; +import org.eclipse.jetty.websocket.api.WebSocketContainer; import org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler; import org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory; -import org.eclipse.jetty.websocket.common.WebSocketContainer; import org.eclipse.jetty.websocket.core.FrameHandler; import org.eclipse.jetty.websocket.servlet.FrameHandlerFactory; import org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest; diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ContainerEndpoint.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ContainerEndpoint.java index efda510856c..e188a109879 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ContainerEndpoint.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ContainerEndpoint.java @@ -22,8 +22,8 @@ import java.util.Collection; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; +import org.eclipse.jetty.websocket.api.WebSocketContainer; import org.eclipse.jetty.websocket.api.WriteCallback; -import org.eclipse.jetty.websocket.common.WebSocketContainer; /** * On Message, return container information diff --git a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerCloseCreator.java b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerCloseCreator.java index 2b2e90f3f0b..e7521981ba9 100644 --- a/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerCloseCreator.java +++ b/jetty-websocket/websocket-jetty-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/ServerCloseCreator.java @@ -21,7 +21,7 @@ package org.eclipse.jetty.websocket.tests.server; import java.util.concurrent.LinkedBlockingQueue; import javax.servlet.ServletContext; -import org.eclipse.jetty.websocket.common.WebSocketContainer; +import org.eclipse.jetty.websocket.api.WebSocketContainer; import org.eclipse.jetty.websocket.server.JettyServerUpgradeRequest; import org.eclipse.jetty.websocket.server.JettyServerUpgradeResponse; import org.eclipse.jetty.websocket.server.JettyWebSocketCreator;