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:
Handler
,HandlerContainer
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
,MappedWebSocketCreator
public class WebSocketUpgradeHandlerWrapper extends HandlerWrapper implements MappedWebSocketCreator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
AbstractHandler.ErrorDispatchHandler
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
_handler
-
-
Constructor Summary
Constructors Constructor Description WebSocketUpgradeHandlerWrapper(ServletContextHandler context)
WebSocketUpgradeHandlerWrapper(ServletContextHandler context, 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(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, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Handle a request.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
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Constructor Detail
-
WebSocketUpgradeHandlerWrapper
public WebSocketUpgradeHandlerWrapper(ServletContextHandler context)
-
WebSocketUpgradeHandlerWrapper
public WebSocketUpgradeHandlerWrapper(ServletContextHandler context, ByteBufferPool bufferPool)
-
-
Method Detail
-
addMapping
public void addMapping(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, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
Description copied from interface:Handler
Handle a request.- Specified by:
handle
in interfaceHandler
- Overrides:
handle
in classHandlerWrapper
- Parameters:
target
- The target of the request - either a URI or a name.baseRequest
- The original unwrapped request object.request
- The request either as theRequest
object or a wrapper of that request. The
method can be used access the Request object if required.HttpConnection.getCurrentConnection()
.getHttpChannel()
.getRequest()
response
- The response as theResponse
object or a wrapper of that request. The
method can be used access the Response object if required.HttpConnection.getCurrentConnection()
.getHttpChannel()
.getResponse()
- Throws:
java.io.IOException
- if unable to handle the request or response processingjavax.servlet.ServletException
- if unable to handle the request or response due to underlying servlet issue
-
-