public class NativeWebSocketConfiguration extends ContainerLifeCycle implements MappedWebSocketCreator, Dumpable
Only applicable if using WebSocketUpgradeFilter
AbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerLifeCycle.Listener| Constructor and Description |
|---|
NativeWebSocketConfiguration(ServletContext context) |
NativeWebSocketConfiguration(WebSocketServerFactory webSocketServerFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMapping(PathSpec pathSpec,
Class<?> endpointClass)
Manually add a WebSocket mapping.
|
void |
addMapping(PathSpec pathSpec,
WebSocketCreator creator)
Manually add a WebSocket mapping.
|
void |
addMapping(PathSpec spec,
WebSocketCreator creator)
Deprecated.
use
addMapping(PathSpec, WebSocketCreator) instead. |
void |
addMapping(String rawspec,
Class<?> endpointClass)
Manually add a WebSocket mapping.
|
void |
addMapping(String rawspec,
WebSocketCreator creator)
Add a mapping, of a pathspec to a WebSocketCreator.
|
void |
doStop() |
String |
dump() |
void |
dump(Appendable out,
String indent) |
WebSocketServerFactory |
getFactory()
Get WebSocketServerFactory being used.
|
WebSocketCreator |
getMapping(String rawspec)
/**
Returns the creator for the given path spec.
|
MappedResource<WebSocketCreator> |
getMatch(String target)
Get the matching
MappedResource for the provided target. |
WebSocketPolicy |
getPolicy()
Used to configure the Default
WebSocketPolicy used by all endpoints that
don't redeclare the values. |
boolean |
removeMapping(String rawspec)
Removes the mapping based on the given path spec.
|
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic NativeWebSocketConfiguration(ServletContext context)
public NativeWebSocketConfiguration(WebSocketServerFactory webSocketServerFactory)
public void doStop()
throws Exception
doStop in class ContainerLifeCycleExceptionpublic String dump()
dump in interface Dumpabledump in class ContainerLifeCyclepublic void dump(Appendable out, String indent) throws IOException
dump in interface Dumpabledump in class ContainerLifeCycleIOExceptionpublic WebSocketServerFactory getFactory()
public MappedResource<WebSocketCreator> getMatch(String target)
MappedResource for the provided target.target - the target pathpublic WebSocketPolicy getPolicy()
WebSocketPolicy used by all endpoints that
don't redeclare the values.public void addMapping(PathSpec pathSpec, WebSocketCreator creator)
If mapping is added before this configuration is started, then it is persisted through stop/start of this configuration's lifecycle. Otherwise it will be removed when this configuration is stopped.
addMapping in interface MappedWebSocketCreatorpathSpec - the pathspec to respond oncreator - the websocket creator to activate on the provided mapping.@Deprecated public void addMapping(PathSpec spec, WebSocketCreator creator)
addMapping(PathSpec, WebSocketCreator) instead.addMapping in interface MappedWebSocketCreatorspec - the pathspec to respond oncreator - the websocket creator to activate on the provided mappingpublic void addMapping(PathSpec pathSpec, Class<?> endpointClass)
pathSpec - the pathspec to respond onendpointClass - the endpoint class to use for new upgrade requests on the provided
pathspec (can be an WebSocket annotated
POJO, or implementing WebSocketListener)public void addMapping(String rawspec, WebSocketCreator creator)
MappedWebSocketCreatorRecognized Path Spec syntaxes
/path/to or / or *.ext or servlet|{spec}^{spec} or regex|{spec}uri-template|{spec}addMapping in interface MappedWebSocketCreatorrawspec - the path spec to use.creator - the websocket creator for this specific mappingpublic WebSocketCreator getMapping(String rawspec)
MappedWebSocketCreatorgetMapping in interface MappedWebSocketCreatorrawspec - @param spec the spec to test for (using the same spec syntax as seen in MappedWebSocketCreator.addMapping(String, WebSocketCreator))public boolean removeMapping(String rawspec)
MappedWebSocketCreatorremoveMapping in interface MappedWebSocketCreatorrawspec - the path spec to remove (using the same spec syntax as seen in MappedWebSocketCreator.addMapping(String, WebSocketCreator))public void addMapping(String rawspec, Class<?> endpointClass)
rawspec - the pathspec to map to (see MappedWebSocketCreator.addMapping(String, WebSocketCreator) for syntax details)endpointClass - the endpoint class to use for new upgrade requests on the provided
pathspec (can be an WebSocket annotated
POJO, or implementing WebSocketListener)Copyright © 1995–2017 Webtide. All rights reserved.