Class WebSocketUpgradeHandlerWrapper
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.server.handler.AbstractHandler
-
- org.eclipse.jetty.server.handler.AbstractHandlerContainer
-
- org.eclipse.jetty.server.handler.HandlerWrapper
-
- org.eclipse.jetty.websocket.server.WebSocketUpgradeHandlerWrapper
-
- All Implemented Interfaces:
org.eclipse.jetty.server.Handler
,org.eclipse.jetty.server.HandlerContainer
,org.eclipse.jetty.util.component.Container
,org.eclipse.jetty.util.component.Destroyable
,org.eclipse.jetty.util.component.Dumpable
,org.eclipse.jetty.util.component.Dumpable.DumpableContainer
,org.eclipse.jetty.util.component.LifeCycle
,MappedWebSocketCreator
public class WebSocketUpgradeHandlerWrapper extends org.eclipse.jetty.server.handler.HandlerWrapper implements MappedWebSocketCreator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
-
-
Field Summary
Fields Modifier and Type Field Description private NativeWebSocketConfiguration
configuration
-
Constructor Summary
Constructors Constructor Description WebSocketUpgradeHandlerWrapper(org.eclipse.jetty.servlet.ServletContextHandler context)
WebSocketUpgradeHandlerWrapper(org.eclipse.jetty.servlet.ServletContextHandler context, org.eclipse.jetty.io.ByteBufferPool bufferPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods 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.useaddMapping(PathSpec, WebSocketCreator)
instead.WebSocketCreator
getMapping(java.lang.String target)
/** Returns the creator for the given path spec.void
handle(java.lang.String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
boolean
removeMapping(java.lang.String spec)
Removes the mapping based on the given path spec.-
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
destroy, expandChildren, getHandler, getHandlers, insertHandler, setHandler
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
doShutdown, expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServer
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
doError, doStart, doStop, getServer
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
configuration
private NativeWebSocketConfiguration configuration
-
-
Constructor Detail
-
WebSocketUpgradeHandlerWrapper
public WebSocketUpgradeHandlerWrapper(org.eclipse.jetty.servlet.ServletContextHandler context)
-
WebSocketUpgradeHandlerWrapper
public WebSocketUpgradeHandlerWrapper(org.eclipse.jetty.servlet.ServletContextHandler context, org.eclipse.jetty.io.ByteBufferPool bufferPool)
-
-
Method Detail
-
addMapping
public void addMapping(org.eclipse.jetty.http.pathmap.PathSpec spec, WebSocketCreator creator)
Description copied from interface:MappedWebSocketCreator
Add a mapping.- Specified by:
addMapping
in interfaceMappedWebSocketCreator
- Parameters:
spec
- the path spec to usecreator
- the creator for the mapping
-
addMapping
@Deprecated public void addMapping(PathSpec spec, WebSocketCreator creator)
Deprecated.useaddMapping(PathSpec, WebSocketCreator)
instead.Add a mapping.- Specified by:
addMapping
in interfaceMappedWebSocketCreator
- Parameters:
spec
- the path spec to usecreator
- the creator for the mapping
-
addMapping
public void addMapping(java.lang.String spec, WebSocketCreator creator)
Description copied from interface:MappedWebSocketCreator
Add a mapping, of a pathspec to a WebSocketCreator.Recognized Path Spec syntaxes
/path/to
or/
or*.ext
orservlet|{spec}
- Servlet Syntax
^{spec}
orregex|{spec}
- Regex Syntax
uri-template|{spec}
- URI Template (see JSR356 and RFC6570 level 1)
- Specified by:
addMapping
in interfaceMappedWebSocketCreator
- Parameters:
spec
- the path spec to use.creator
- the websocket creator for this specific mapping
-
removeMapping
public boolean removeMapping(java.lang.String spec)
Description copied from interface:MappedWebSocketCreator
Removes the mapping based on the given path spec.- Specified by:
removeMapping
in interfaceMappedWebSocketCreator
- Parameters:
spec
- the path spec to remove (using the same spec syntax as seen inMappedWebSocketCreator.addMapping(String, WebSocketCreator)
)- Returns:
- true if underlying mapping were altered, false otherwise
-
getMapping
public WebSocketCreator getMapping(java.lang.String target)
Description copied from interface:MappedWebSocketCreator
/** Returns the creator for the given path spec.- Specified by:
getMapping
in interfaceMappedWebSocketCreator
- Parameters:
target
- the spec to test for (using the same spec syntax as seen inMappedWebSocketCreator.addMapping(String, WebSocketCreator)
)- Returns:
- the websocket creator if path spec exists, or null
-
handle
public void handle(java.lang.String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
- Specified by:
handle
in interfaceorg.eclipse.jetty.server.Handler
- Overrides:
handle
in classorg.eclipse.jetty.server.handler.HandlerWrapper
- Throws:
java.io.IOException
javax.servlet.ServletException
-
-