Filter, org.eclipse.jetty.util.component.Dumpable, MappedWebSocketCreator@ManagedObject("WebSocket Upgrade Filter")
public class WebSocketUpgradeFilter
extends java.lang.Object
implements Filter, MappedWebSocketCreator, org.eclipse.jetty.util.component.Dumpable
WebSocketCreator objects.| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
CONFIG_ATTRIBUTE_KEY |
|
static java.lang.String |
CONTEXT_ATTRIBUTE_KEY |
| Constructor | Description |
|---|---|
WebSocketUpgradeFilter() |
|
WebSocketUpgradeFilter(NativeWebSocketConfiguration configuration) |
|
WebSocketUpgradeFilter(WebSocketServerFactory factory) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addMapping(java.lang.String spec,
WebSocketCreator creator) |
Add a mapping, of a pathspec to a WebSocketCreator.
|
void |
addMapping(org.eclipse.jetty.http.pathmap.PathSpec spec,
WebSocketCreator creator) |
Add a mapping.
|
void |
addMapping(PathSpec spec,
WebSocketCreator creator) |
Deprecated.
|
static WebSocketUpgradeFilter |
configureContext(ServletContext context) |
Deprecated.
use
configureContext(ServletContextHandler) instead |
static WebSocketUpgradeFilter |
configureContext(org.eclipse.jetty.servlet.ServletContextHandler context) |
|
void |
destroy() |
|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain) |
|
java.lang.String |
dump() |
|
void |
dump(java.lang.Appendable out,
java.lang.String indent) |
|
NativeWebSocketConfiguration |
getConfiguration() |
|
WebSocketServletFactory |
getFactory() |
|
WebSocketCreator |
getMapping(java.lang.String target) |
/**
Returns the creator for the given path spec.
|
void |
init(FilterConfig config) |
|
boolean |
removeMapping(java.lang.String spec) |
Removes the mapping based on the given path spec.
|
void |
setToAttribute(ServletContext context,
java.lang.String key) |
|
java.lang.String |
toString() |
public static final java.lang.String CONTEXT_ATTRIBUTE_KEY
public static final java.lang.String CONFIG_ATTRIBUTE_KEY
public WebSocketUpgradeFilter()
public WebSocketUpgradeFilter(WebSocketServerFactory factory)
public WebSocketUpgradeFilter(NativeWebSocketConfiguration configuration)
public static WebSocketUpgradeFilter configureContext(org.eclipse.jetty.servlet.ServletContextHandler context) throws ServletException
context - the ServletContextHandler to useWebSocketUpgradeFilter instanceServletException - if the filer cannot be configured@Deprecated public static WebSocketUpgradeFilter configureContext(ServletContext context) throws ServletException
configureContext(ServletContextHandler) insteadcontext - the ServletContext to useWebSocketUpgradeFilter instanceServletException - if the filer cannot be configuredpublic void addMapping(org.eclipse.jetty.http.pathmap.PathSpec spec,
WebSocketCreator creator)
MappedWebSocketCreatoraddMapping in interface MappedWebSocketCreatorspec - the path spec to usecreator - the creator for the mapping@Deprecated public void addMapping(PathSpec spec, WebSocketCreator creator)
addMapping(org.eclipse.jetty.http.pathmap.PathSpec, WebSocketCreator) insteadMappedWebSocketCreatoraddMapping in interface MappedWebSocketCreatorspec - the path spec to usecreator - the creator for the mappingpublic void addMapping(java.lang.String spec,
WebSocketCreator creator)
MappedWebSocketCreatorRecognized Path Spec syntaxes
/path/to or / or *.ext or servlet|{spec}^{spec} or regex|{spec}uri-template|{spec}addMapping in interface MappedWebSocketCreatorspec - the path spec to use.creator - the websocket creator for this specific mappingpublic boolean removeMapping(java.lang.String spec)
MappedWebSocketCreatorremoveMapping in interface MappedWebSocketCreatorspec - the path spec to remove (using the same spec syntax as seen in MappedWebSocketCreator.addMapping(String, WebSocketCreator))public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException
doFilter in interface Filterjava.io.IOExceptionServletExceptionpublic java.lang.String dump()
dump in interface org.eclipse.jetty.util.component.Dumpablepublic void dump(java.lang.Appendable out,
java.lang.String indent)
throws java.io.IOException
dump in interface org.eclipse.jetty.util.component.Dumpablejava.io.IOExceptionpublic WebSocketServletFactory getFactory()
@ManagedAttribute(value="configuration",
readonly=true)
public NativeWebSocketConfiguration getConfiguration()
public WebSocketCreator getMapping(java.lang.String target)
MappedWebSocketCreatorgetMapping in interface MappedWebSocketCreatortarget - the spec to test for (using the same spec syntax as seen in MappedWebSocketCreator.addMapping(String, WebSocketCreator))public void init(FilterConfig config) throws ServletException
init in interface FilterServletExceptionpublic void setToAttribute(ServletContext context, java.lang.String key) throws ServletException
ServletExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1995–2018 Webtide. All rights reserved.