Issue #2504 - expose more WebSocket details in jetty server dump
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
2426b34a51
commit
bd7f1b114e
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<JavaxWebSocketSessionListener> 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue