JSR-356 - Making WebSocketUpgradeFilter an attribute in the ServletContext
This commit is contained in:
parent
9c41f57b7c
commit
b549410932
|
@ -49,7 +49,11 @@ public class WebSocketConfiguration extends AbstractConfiguration
|
|||
String pathSpec = "/*";
|
||||
context.addFilter(fholder,pathSpec,EnumSet.of(DispatcherType.REQUEST));
|
||||
LOG.debug("Adding {} mapped to {} to {}",filter,pathSpec,context);
|
||||
|
||||
// Store reference to the WebSocketUpgradeFilter
|
||||
context.setAttribute(WebSocketUpgradeFilter.class.getName(),filter);
|
||||
|
||||
// Store reference to the ServerContainer
|
||||
ServerContainer container = new ServerContainer(filter);
|
||||
filter.setWebSocketServerFactoryListener(container);
|
||||
context.setAttribute(JAVAX_WEBSOCKET_SERVER_CONTAINER,container);
|
||||
|
|
|
@ -64,7 +64,7 @@ public class WebSocketUpgradeFilter implements Filter, MappedWebSocketCreator, D
|
|||
{
|
||||
factory.cleanup();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
|
||||
{
|
||||
|
@ -138,6 +138,11 @@ public class WebSocketUpgradeFilter implements Filter, MappedWebSocketCreator, D
|
|||
pathmap.dump(out,indent + " ");
|
||||
}
|
||||
|
||||
public WebSocketServerFactory getFactory()
|
||||
{
|
||||
return factory;
|
||||
}
|
||||
|
||||
@ManagedAttribute(value = "mappings", readonly = true)
|
||||
@Override
|
||||
public PathMappings<WebSocketCreator> getMappings()
|
||||
|
|
Loading…
Reference in New Issue