public class NativeWebSocketConfiguration extends ContainerLifeCycle implements MappedWebSocketCreator, Dumpable
Only applicable if using WebSocketUpgradeFilter
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
Constructor and Description |
---|
NativeWebSocketConfiguration() |
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()
Stops the managed lifecycle beans in the reverse order they were added.
|
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.
|
PathMappings<WebSocketCreator> |
getMappings()
Get all of the PathMappings declared.
|
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, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public NativeWebSocketConfiguration()
public NativeWebSocketConfiguration(WebSocketServerFactory webSocketServerFactory)
public void doStop() throws Exception
ContainerLifeCycle
doStop
in class ContainerLifeCycle
Exception
public String dump()
dump
in interface Dumpable
dump
in class ContainerLifeCycle
public void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
dump
in class ContainerLifeCycle
IOException
public 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)
addMapping
in interface MappedWebSocketCreator
pathSpec
- 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 MappedWebSocketCreator
spec
- 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)
MappedWebSocketCreator
Recognized Path Spec syntaxes
/path/to
or /
or *.ext
or servlet|{spec}
^{spec}
or regex|{spec}
uri-template|{spec}
addMapping
in interface MappedWebSocketCreator
rawspec
- the path spec to use.creator
- the websocket creator for this specific mappingpublic WebSocketCreator getMapping(String rawspec)
MappedWebSocketCreator
getMapping
in interface MappedWebSocketCreator
rawspec
- @param spec the spec to test for (using the same spec syntax as seen in MappedWebSocketCreator.addMapping(String, WebSocketCreator)
)public boolean removeMapping(String rawspec)
MappedWebSocketCreator
removeMapping
in interface MappedWebSocketCreator
rawspec
- 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
)public PathMappings<WebSocketCreator> getMappings()
MappedWebSocketCreator
getMappings
in interface MappedWebSocketCreator
Copyright © 1995-2017 Webtide. All Rights Reserved.