rename of WebSocketResources to WebSocketComponents
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
b2f2a16aed
commit
0c85b3138f
|
@ -22,7 +22,6 @@ import java.time.Duration;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.websocket.DeploymentException;
|
import javax.websocket.DeploymentException;
|
||||||
import javax.websocket.EndpointConfig;
|
import javax.websocket.EndpointConfig;
|
||||||
|
@ -43,9 +42,9 @@ import org.eclipse.jetty.util.component.LifeCycle;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||||
|
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketException;
|
import org.eclipse.jetty.websocket.core.WebSocketException;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry;
|
import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketResources;
|
|
||||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||||
import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer;
|
import org.eclipse.jetty.websocket.javax.client.JavaxWebSocketClientContainer;
|
||||||
import org.eclipse.jetty.websocket.javax.server.internal.AnnotatedServerEndpointConfig;
|
import org.eclipse.jetty.websocket.javax.server.internal.AnnotatedServerEndpointConfig;
|
||||||
|
@ -108,7 +107,7 @@ public class JavaxWebSocketServerContainer
|
||||||
// Create the Jetty ServerContainer implementation
|
// Create the Jetty ServerContainer implementation
|
||||||
container = new JavaxWebSocketServerContainer(
|
container = new JavaxWebSocketServerContainer(
|
||||||
WebSocketMapping.ensureMapping(servletContext, WebSocketMapping.DEFAULT_KEY),
|
WebSocketMapping.ensureMapping(servletContext, WebSocketMapping.DEFAULT_KEY),
|
||||||
WebSocketResources.ensureWebSocketResources(servletContext),
|
WebSocketComponents.ensureWebSocketComponents(servletContext),
|
||||||
httpClient, executor);
|
httpClient, executor);
|
||||||
contextHandler.addManaged(container);
|
contextHandler.addManaged(container);
|
||||||
contextHandler.addLifeCycleListener(container);
|
contextHandler.addLifeCycleListener(container);
|
||||||
|
@ -119,7 +118,7 @@ public class JavaxWebSocketServerContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
private final WebSocketMapping webSocketMapping;
|
private final WebSocketMapping webSocketMapping;
|
||||||
private final WebSocketResources webSocketResources;
|
private final WebSocketComponents webSocketComponents;
|
||||||
private final JavaxWebSocketServerFrameHandlerFactory frameHandlerFactory;
|
private final JavaxWebSocketServerFrameHandlerFactory frameHandlerFactory;
|
||||||
private final Executor executor;
|
private final Executor executor;
|
||||||
private final FrameHandler.ConfigurationCustomizer customizer = new FrameHandler.ConfigurationCustomizer();
|
private final FrameHandler.ConfigurationCustomizer customizer = new FrameHandler.ConfigurationCustomizer();
|
||||||
|
@ -130,16 +129,16 @@ public class JavaxWebSocketServerContainer
|
||||||
|
|
||||||
public JavaxWebSocketServerContainer(WebSocketMapping webSocketMapping, HttpClient httpClient, Executor executor)
|
public JavaxWebSocketServerContainer(WebSocketMapping webSocketMapping, HttpClient httpClient, Executor executor)
|
||||||
{
|
{
|
||||||
this(webSocketMapping, new WebSocketResources(), httpClient, executor);
|
this(webSocketMapping, new WebSocketComponents(), httpClient, executor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main entry point for {@link JavaxWebSocketServletContainerInitializer}.
|
* Main entry point for {@link JavaxWebSocketServletContainerInitializer}.
|
||||||
* @param webSocketMapping the {@link WebSocketMapping} that this container belongs to
|
* @param webSocketMapping the {@link WebSocketMapping} that this container belongs to
|
||||||
* @param webSocketResources the {@link WebSocketResources} instance to use
|
* @param webSocketComponents the {@link WebSocketComponents} instance to use
|
||||||
* @param httpClient the {@link HttpClient} instance to use
|
* @param httpClient the {@link HttpClient} instance to use
|
||||||
*/
|
*/
|
||||||
public JavaxWebSocketServerContainer(WebSocketMapping webSocketMapping, WebSocketResources webSocketResources, HttpClient httpClient, Executor executor)
|
public JavaxWebSocketServerContainer(WebSocketMapping webSocketMapping, WebSocketComponents webSocketComponents, HttpClient httpClient, Executor executor)
|
||||||
{
|
{
|
||||||
super(() ->
|
super(() ->
|
||||||
{
|
{
|
||||||
|
@ -149,7 +148,7 @@ public class JavaxWebSocketServerContainer
|
||||||
return client;
|
return client;
|
||||||
});
|
});
|
||||||
this.webSocketMapping = webSocketMapping;
|
this.webSocketMapping = webSocketMapping;
|
||||||
this.webSocketResources = webSocketResources;
|
this.webSocketComponents = webSocketComponents;
|
||||||
this.executor = executor;
|
this.executor = executor;
|
||||||
this.frameHandlerFactory = new JavaxWebSocketServerFrameHandlerFactory(this);
|
this.frameHandlerFactory = new JavaxWebSocketServerFrameHandlerFactory(this);
|
||||||
}
|
}
|
||||||
|
@ -170,7 +169,7 @@ public class JavaxWebSocketServerContainer
|
||||||
@Override
|
@Override
|
||||||
public ByteBufferPool getBufferPool()
|
public ByteBufferPool getBufferPool()
|
||||||
{
|
{
|
||||||
return webSocketResources.getBufferPool();
|
return webSocketComponents.getBufferPool();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -182,7 +181,7 @@ public class JavaxWebSocketServerContainer
|
||||||
@Override
|
@Override
|
||||||
public WebSocketExtensionRegistry getExtensionRegistry()
|
public WebSocketExtensionRegistry getExtensionRegistry()
|
||||||
{
|
{
|
||||||
return webSocketResources.getExtensionRegistry();
|
return webSocketComponents.getExtensionRegistry();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -194,7 +193,7 @@ public class JavaxWebSocketServerContainer
|
||||||
@Override
|
@Override
|
||||||
public DecoratedObjectFactory getObjectFactory()
|
public DecoratedObjectFactory getObjectFactory()
|
||||||
{
|
{
|
||||||
return webSocketResources.getObjectFactory();
|
return webSocketComponents.getObjectFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -288,7 +287,7 @@ public class JavaxWebSocketServerContainer
|
||||||
{
|
{
|
||||||
frameHandlerFactory.getMetadata(config.getEndpointClass(), config);
|
frameHandlerFactory.getMetadata(config.getEndpointClass(), config);
|
||||||
|
|
||||||
JavaxWebSocketCreator creator = new JavaxWebSocketCreator(this, config, webSocketResources
|
JavaxWebSocketCreator creator = new JavaxWebSocketCreator(this, config, webSocketComponents
|
||||||
.getExtensionRegistry());
|
.getExtensionRegistry());
|
||||||
|
|
||||||
PathSpec pathSpec = new UriTemplatePathSpec(config.getPath());
|
PathSpec pathSpec = new UriTemplatePathSpec(config.getPath());
|
||||||
|
|
|
@ -20,7 +20,6 @@ package org.eclipse.jetty.websocket.javax.server;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.servlet.ServletContainerInitializer;
|
import javax.servlet.ServletContainerInitializer;
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
|
@ -37,7 +36,7 @@ import org.eclipse.jetty.util.TypeUtil;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.eclipse.jetty.util.thread.ThreadClassLoaderScope;
|
import org.eclipse.jetty.util.thread.ThreadClassLoaderScope;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketResources;
|
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||||
import org.eclipse.jetty.websocket.servlet.WebSocketMapping;
|
import org.eclipse.jetty.websocket.servlet.WebSocketMapping;
|
||||||
import org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter;
|
import org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter;
|
||||||
|
|
||||||
|
@ -84,13 +83,13 @@ public class JavaxWebSocketServletContainerInitializer implements ServletContain
|
||||||
|
|
||||||
public static JavaxWebSocketServerContainer configureContext(ServletContextHandler context)
|
public static JavaxWebSocketServerContainer configureContext(ServletContextHandler context)
|
||||||
{
|
{
|
||||||
WebSocketResources resources = WebSocketResources.ensureWebSocketResources(context.getServletContext());
|
WebSocketComponents components = WebSocketComponents.ensureWebSocketComponents(context.getServletContext());
|
||||||
FilterHolder filterHolder = WebSocketUpgradeFilter.ensureFilter(context.getServletContext());
|
FilterHolder filterHolder = WebSocketUpgradeFilter.ensureFilter(context.getServletContext());
|
||||||
WebSocketMapping mapping = WebSocketMapping.ensureMapping(context.getServletContext(), WebSocketMapping.DEFAULT_KEY);
|
WebSocketMapping mapping = WebSocketMapping.ensureMapping(context.getServletContext(), WebSocketMapping.DEFAULT_KEY);
|
||||||
JavaxWebSocketServerContainer container = JavaxWebSocketServerContainer.ensureContainer(context.getServletContext());
|
JavaxWebSocketServerContainer container = JavaxWebSocketServerContainer.ensureContainer(context.getServletContext());
|
||||||
|
|
||||||
if (LOG.isDebugEnabled())
|
if (LOG.isDebugEnabled())
|
||||||
LOG.debug("configureContext {} {} {} {}", mapping, resources, filterHolder, container);
|
LOG.debug("configureContext {} {} {} {}", mapping, components, filterHolder, container);
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ package org.eclipse.jetty.websocket.server;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.servlet.ServletContainerInitializer;
|
import javax.servlet.ServletContainerInitializer;
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
|
@ -29,7 +28,7 @@ import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketResources;
|
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ServletContext configuration for Jetty Native WebSockets API.
|
* ServletContext configuration for Jetty Native WebSockets API.
|
||||||
|
@ -73,10 +72,10 @@ public class JettyWebSocketServletContainerInitializer implements ServletContain
|
||||||
@Override
|
@Override
|
||||||
public void onStartup(Set<Class<?>> c, ServletContext servletContext) throws ServletException
|
public void onStartup(Set<Class<?>> c, ServletContext servletContext) throws ServletException
|
||||||
{
|
{
|
||||||
WebSocketResources resources = WebSocketResources.ensureWebSocketResources(servletContext);
|
WebSocketComponents components = WebSocketComponents.ensureWebSocketComponents(servletContext);
|
||||||
JettyServerFrameHandlerFactory factory = JettyServerFrameHandlerFactory.ensureFactory(servletContext);
|
JettyServerFrameHandlerFactory factory = JettyServerFrameHandlerFactory.ensureFactory(servletContext);
|
||||||
|
|
||||||
if (LOG.isDebugEnabled())
|
if (LOG.isDebugEnabled())
|
||||||
LOG.debug("onStartup {} {}", resources, factory);
|
LOG.debug("onStartup {} {}", components, factory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,29 +25,29 @@ import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||||
import org.eclipse.jetty.util.DecoratedObjectFactory;
|
import org.eclipse.jetty.util.DecoratedObjectFactory;
|
||||||
|
|
||||||
public class WebSocketResources
|
public class WebSocketComponents
|
||||||
{
|
{
|
||||||
public static WebSocketResources ensureWebSocketResources(ServletContext servletContext)
|
public static WebSocketComponents ensureWebSocketComponents(ServletContext servletContext)
|
||||||
{
|
{
|
||||||
ContextHandler contextHandler = ContextHandler.getContextHandler(servletContext);
|
ContextHandler contextHandler = ContextHandler.getContextHandler(servletContext);
|
||||||
|
|
||||||
// Ensure a mapping exists
|
// Ensure a mapping exists
|
||||||
WebSocketResources resources = contextHandler.getBean(WebSocketResources.class);
|
WebSocketComponents components = contextHandler.getBean(WebSocketComponents.class);
|
||||||
if (resources == null)
|
if (components == null)
|
||||||
{
|
{
|
||||||
resources = new WebSocketResources();
|
components = new WebSocketComponents();
|
||||||
contextHandler.addBean(resources);
|
contextHandler.addBean(components);
|
||||||
}
|
}
|
||||||
|
|
||||||
return resources;
|
return components;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WebSocketResources()
|
public WebSocketComponents()
|
||||||
{
|
{
|
||||||
this(new WebSocketExtensionRegistry(), new DecoratedObjectFactory(), new MappedByteBufferPool());
|
this(new WebSocketExtensionRegistry(), new DecoratedObjectFactory(), new MappedByteBufferPool());
|
||||||
}
|
}
|
||||||
|
|
||||||
public WebSocketResources(WebSocketExtensionRegistry extensionRegistry, DecoratedObjectFactory objectFactory, ByteBufferPool bufferPool)
|
public WebSocketComponents(WebSocketExtensionRegistry extensionRegistry, DecoratedObjectFactory objectFactory, ByteBufferPool bufferPool)
|
||||||
{
|
{
|
||||||
this.extensionRegistry = extensionRegistry;
|
this.extensionRegistry = extensionRegistry;
|
||||||
this.objectFactory = objectFactory;
|
this.objectFactory = objectFactory;
|
|
@ -21,7 +21,6 @@ package org.eclipse.jetty.websocket.servlet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
@ -39,8 +38,8 @@ import org.eclipse.jetty.util.component.LifeCycle;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||||
|
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketException;
|
import org.eclipse.jetty.websocket.core.WebSocketException;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketResources;
|
|
||||||
import org.eclipse.jetty.websocket.core.server.Handshaker;
|
import org.eclipse.jetty.websocket.core.server.Handshaker;
|
||||||
import org.eclipse.jetty.websocket.core.server.Negotiation;
|
import org.eclipse.jetty.websocket.core.server.Negotiation;
|
||||||
import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator;
|
import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator;
|
||||||
|
@ -75,7 +74,7 @@ public class WebSocketMapping implements Dumpable, LifeCycle.Listener
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WebSocketMapping mapping = new WebSocketMapping(WebSocketResources.ensureWebSocketResources(servletContext));
|
WebSocketMapping mapping = new WebSocketMapping(WebSocketComponents.ensureWebSocketComponents(servletContext));
|
||||||
contextHandler.setAttribute(mappingKey, mapping);
|
contextHandler.setAttribute(mappingKey, mapping);
|
||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
@ -84,17 +83,17 @@ public class WebSocketMapping implements Dumpable, LifeCycle.Listener
|
||||||
public static final String DEFAULT_KEY = "org.eclipse.jetty.websocket.WebSocketMapping";
|
public static final String DEFAULT_KEY = "org.eclipse.jetty.websocket.WebSocketMapping";
|
||||||
|
|
||||||
private final PathMappings<Negotiator> mappings = new PathMappings<>();
|
private final PathMappings<Negotiator> mappings = new PathMappings<>();
|
||||||
private final WebSocketResources resources;
|
private final WebSocketComponents components;
|
||||||
private final Handshaker handshaker = Handshaker.newInstance();
|
private final Handshaker handshaker = Handshaker.newInstance();
|
||||||
|
|
||||||
public WebSocketMapping()
|
public WebSocketMapping()
|
||||||
{
|
{
|
||||||
this(new WebSocketResources());
|
this(new WebSocketComponents());
|
||||||
}
|
}
|
||||||
|
|
||||||
public WebSocketMapping(WebSocketResources resources)
|
public WebSocketMapping(WebSocketComponents components)
|
||||||
{
|
{
|
||||||
this.resources = resources;
|
this.components = components;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -253,7 +252,7 @@ public class WebSocketMapping implements Dumpable, LifeCycle.Listener
|
||||||
|
|
||||||
public Negotiator(WebSocketCreator creator, FrameHandlerFactory factory, FrameHandler.Customizer customizer)
|
public Negotiator(WebSocketCreator creator, FrameHandlerFactory factory, FrameHandler.Customizer customizer)
|
||||||
{
|
{
|
||||||
super(resources.getExtensionRegistry(), resources.getObjectFactory(), resources.getBufferPool(), customizer);
|
super(components.getExtensionRegistry(), components.getObjectFactory(), components.getBufferPool(), customizer);
|
||||||
this.creator = creator;
|
this.creator = creator;
|
||||||
this.factory = factory;
|
this.factory = factory;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ package org.eclipse.jetty.websocket.servlet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.http.HttpServlet;
|
import javax.servlet.http.HttpServlet;
|
||||||
|
@ -34,8 +33,8 @@ import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||||
|
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry;
|
import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketResources;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract Servlet used to bridge the Servlet API to the WebSocket API.
|
* Abstract Servlet used to bridge the Servlet API to the WebSocket API.
|
||||||
|
@ -96,7 +95,7 @@ public abstract class WebSocketServlet extends HttpServlet
|
||||||
private final CustomizedWebSocketServletFactory customizer = new CustomizedWebSocketServletFactory();
|
private final CustomizedWebSocketServletFactory customizer = new CustomizedWebSocketServletFactory();
|
||||||
|
|
||||||
private WebSocketMapping mapping;
|
private WebSocketMapping mapping;
|
||||||
private WebSocketResources resources;
|
private WebSocketComponents components;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure the WebSocketServletFactory for this servlet instance by setting default
|
* Configure the WebSocketServletFactory for this servlet instance by setting default
|
||||||
|
@ -114,8 +113,8 @@ public abstract class WebSocketServlet extends HttpServlet
|
||||||
{
|
{
|
||||||
ServletContext servletContext = getServletContext();
|
ServletContext servletContext = getServletContext();
|
||||||
|
|
||||||
resources = WebSocketResources.ensureWebSocketResources(servletContext);
|
components = WebSocketComponents.ensureWebSocketComponents(servletContext);
|
||||||
mapping = new WebSocketMapping(resources);
|
mapping = new WebSocketMapping(components);
|
||||||
|
|
||||||
String max = getInitParameter("maxIdleTime");
|
String max = getInitParameter("maxIdleTime");
|
||||||
if (max != null)
|
if (max != null)
|
||||||
|
@ -180,7 +179,7 @@ public abstract class WebSocketServlet extends HttpServlet
|
||||||
{
|
{
|
||||||
public WebSocketExtensionRegistry getExtensionRegistry()
|
public WebSocketExtensionRegistry getExtensionRegistry()
|
||||||
{
|
{
|
||||||
return resources.getExtensionRegistry();
|
return components.getExtensionRegistry();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,7 +21,6 @@ package org.eclipse.jetty.websocket.servlet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import javax.servlet.DispatcherType;
|
import javax.servlet.DispatcherType;
|
||||||
import javax.servlet.Filter;
|
import javax.servlet.Filter;
|
||||||
import javax.servlet.FilterChain;
|
import javax.servlet.FilterChain;
|
||||||
|
@ -42,7 +41,7 @@ import org.eclipse.jetty.util.component.Dumpable;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||||
import org.eclipse.jetty.websocket.core.WebSocketResources;
|
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inline Servlet Filter to capture WebSocket upgrade requests.
|
* Inline Servlet Filter to capture WebSocket upgrade requests.
|
||||||
|
@ -164,7 +163,7 @@ public class WebSocketUpgradeFilter implements Filter, Dumpable
|
||||||
if (mappingKey != null)
|
if (mappingKey != null)
|
||||||
mapping = WebSocketMapping.ensureMapping(context, mappingKey);
|
mapping = WebSocketMapping.ensureMapping(context, mappingKey);
|
||||||
else
|
else
|
||||||
mapping = new WebSocketMapping(WebSocketResources.ensureWebSocketResources(context));
|
mapping = new WebSocketMapping(WebSocketComponents.ensureWebSocketComponents(context));
|
||||||
|
|
||||||
String max = config.getInitParameter("maxIdleTime");
|
String max = config.getInitParameter("maxIdleTime");
|
||||||
if (max != null)
|
if (max != null)
|
||||||
|
|
Loading…
Reference in New Issue