JSR-356 - Making WebSocketUpgradeFilter an attribute in the ServletContext
This commit is contained in:
parent
9c41f57b7c
commit
b549410932
|
@ -50,6 +50,10 @@ public class WebSocketConfiguration extends AbstractConfiguration
|
||||||
context.addFilter(fholder,pathSpec,EnumSet.of(DispatcherType.REQUEST));
|
context.addFilter(fholder,pathSpec,EnumSet.of(DispatcherType.REQUEST));
|
||||||
LOG.debug("Adding {} mapped to {} to {}",filter,pathSpec,context);
|
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);
|
ServerContainer container = new ServerContainer(filter);
|
||||||
filter.setWebSocketServerFactoryListener(container);
|
filter.setWebSocketServerFactoryListener(container);
|
||||||
context.setAttribute(JAVAX_WEBSOCKET_SERVER_CONTAINER,container);
|
context.setAttribute(JAVAX_WEBSOCKET_SERVER_CONTAINER,container);
|
||||||
|
|
|
@ -138,6 +138,11 @@ public class WebSocketUpgradeFilter implements Filter, MappedWebSocketCreator, D
|
||||||
pathmap.dump(out,indent + " ");
|
pathmap.dump(out,indent + " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WebSocketServerFactory getFactory()
|
||||||
|
{
|
||||||
|
return factory;
|
||||||
|
}
|
||||||
|
|
||||||
@ManagedAttribute(value = "mappings", readonly = true)
|
@ManagedAttribute(value = "mappings", readonly = true)
|
||||||
@Override
|
@Override
|
||||||
public PathMappings<WebSocketCreator> getMappings()
|
public PathMappings<WebSocketCreator> getMappings()
|
||||||
|
|
Loading…
Reference in New Issue