diff --git a/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Configuration.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Configuration.java index 4ffaba499e1..830e25bb48c 100644 --- a/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Configuration.java +++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Configuration.java @@ -238,5 +238,15 @@ public interface Configuration if (maxOutgoingFrames != null) configurable.setMaxOutgoingFrames(maxOutgoingFrames); } + + @Override + public String toString() + { + return String.format("%s@%x{idleTimeout=%s, writeTimeout=%s, autoFragment=%s, maxFrameSize=%s, " + + "inputBufferSize=%s, outputBufferSize=%s, maxBinaryMessageSize=%s, maxTextMessageSize=%s, maxOutgoingFrames=%s}", + getClass().getSimpleName(), hashCode(), + idleTimeout, writeTimeout, autoFragment, maxFrameSize, inputBufferSize, outputBufferSize, + maxBinaryMessageSize, maxTextMessageSize, maxOutgoingFrames); + } } } diff --git a/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketMappings.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketMappings.java index dc72d911fb3..ceae5c65b61 100644 --- a/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketMappings.java +++ b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketMappings.java @@ -141,12 +141,6 @@ public class WebSocketMappings implements Dumpable, LifeCycle.Listener } } - @Override - public String dump() - { - return Dumpable.dump(this); - } - @Override public void dump(Appendable out, String indent) throws IOException { diff --git a/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketServerComponents.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketServerComponents.java index d5cd19562f2..07f194122ac 100644 --- a/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketServerComponents.java +++ b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketServerComponents.java @@ -112,6 +112,12 @@ public class WebSocketServerComponents extends WebSocketComponents contextHandler.removeBean(serverComponents); contextHandler.removeEventListener(this); } + + @Override + public String toString() + { + return String.format("%sCleanupListener", WebSocketServerComponents.class.getSimpleName()); + } }); servletContext.setAttribute(WEBSOCKET_COMPONENTS_ATTRIBUTE, serverComponents); diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketContainer.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketContainer.java index 225d5eec8bd..641c8ce2cca 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketContainer.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketContainer.java @@ -13,6 +13,7 @@ package org.eclipse.jetty.websocket.javax.common; +import java.io.IOException; import java.time.Duration; import java.util.ArrayList; import java.util.HashSet; @@ -26,13 +27,14 @@ import javax.websocket.WebSocketContainer; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.util.DecoratedObjectFactory; import org.eclipse.jetty.util.component.ContainerLifeCycle; +import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.websocket.core.Configuration; import org.eclipse.jetty.websocket.core.WebSocketComponents; import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public abstract class JavaxWebSocketContainer extends ContainerLifeCycle implements javax.websocket.WebSocketContainer +public abstract class JavaxWebSocketContainer extends ContainerLifeCycle implements javax.websocket.WebSocketContainer, Dumpable { private static final Logger LOG = LoggerFactory.getLogger(JavaxWebSocketContainer.class); private final List sessionListeners = new ArrayList<>(); @@ -198,4 +200,10 @@ public abstract class JavaxWebSocketContainer extends ContainerLifeCycle impleme } } } + + @Override + public void dump(Appendable out, String indent) throws IOException + { + Dumpable.dumpObjects(out, indent, this, defaultCustomizer); + } } 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 6683b931244..364b95686c9 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 @@ -106,6 +106,12 @@ public class JavaxWebSocketServerContainer extends JavaxWebSocketClientContainer contextHandler.removeEventListener(container); contextHandler.removeEventListener(this); } + + @Override + public String toString() + { + return String.format("%sCleanupListener", JavaxWebSocketServerContainer.class.getSimpleName()); + } }); // Store a reference to the ServerContainer per - javax.websocket spec 1.0 final - section 6.4: Programmatic Server Deployment 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 bd4089285dc..baba13bf73b 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 @@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.pathmap.PathSpec; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.component.ContainerLifeCycle; +import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.component.LifeCycle; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketBehavior; @@ -94,6 +95,12 @@ public class JettyWebSocketServerContainer extends ContainerLifeCycle implements contextHandler.removeEventListener(container); contextHandler.removeEventListener(this); } + + @Override + public String toString() + { + return String.format("%sCleanupListener", JettyWebSocketServerContainer.class.getSimpleName()); + } }); servletContext.setAttribute(JETTY_WEBSOCKET_CONTAINER_ATTRIBUTE, container); @@ -306,4 +313,10 @@ public class JettyWebSocketServerContainer extends ContainerLifeCycle implements { customizer.setAutoFragment(autoFragment); } + + @Override + public void dump(Appendable out, String indent) throws IOException + { + Dumpable.dumpObjects(out, indent, this, customizer); + } } diff --git a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketUpgradeFilter.java b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketUpgradeFilter.java index e945491746e..d19cea2b508 100644 --- a/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketUpgradeFilter.java +++ b/jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketUpgradeFilter.java @@ -134,6 +134,12 @@ public class WebSocketUpgradeFilter implements Filter, Dumpable servletHandler.removeFilterMapping(mapping); contextHandler.removeEventListener(this); } + + @Override + public String toString() + { + return String.format("%sCleanupListener", WebSocketUpgradeFilter.class.getSimpleName()); + } }); if (LOG.isDebugEnabled()) @@ -164,16 +170,10 @@ public class WebSocketUpgradeFilter implements Filter, Dumpable chain.doFilter(request, response); } - @Override - public String dump() - { - return Dumpable.dump(this); - } - @Override public void dump(Appendable out, String indent) throws IOException { - Dumpable.dumpObjects(out, indent, this, mappings); + Dumpable.dumpObjects(out, indent, this, defaultCustomizer, mappings); } @Override