public class WebSocketServerFactory extends ContainerLifeCycle implements WebSocketCreator, WebSocketServletFactory
AbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerLifeCycle.Listener| Constructor and Description |
|---|
WebSocketServerFactory() |
WebSocketServerFactory(org.eclipse.jetty.websocket.api.WebSocketPolicy policy) |
WebSocketServerFactory(org.eclipse.jetty.websocket.api.WebSocketPolicy policy,
ByteBufferPool bufferPool) |
addBean, addBean, addBean, contains, destroy, doStart, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, setBeans, setStopTimeout, start, unmanage, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic WebSocketServerFactory()
public WebSocketServerFactory(org.eclipse.jetty.websocket.api.WebSocketPolicy policy)
public WebSocketServerFactory(org.eclipse.jetty.websocket.api.WebSocketPolicy policy, ByteBufferPool bufferPool)
public static UpgradeContext getActiveUpgradeContext()
protected static void setActiveUpgradeContext(UpgradeContext connection)
public boolean acceptWebSocket(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
acceptWebSocket in interface WebSocketServletFactoryIOExceptionpublic void cleanup()
cleanup in interface WebSocketServletFactoryprotected void closeAllConnections()
public WebSocketServletFactory createFactory(org.eclipse.jetty.websocket.api.WebSocketPolicy policy)
createFactory in interface WebSocketServletFactorypublic Object createWebSocket(org.eclipse.jetty.websocket.api.UpgradeRequest req, org.eclipse.jetty.websocket.api.UpgradeResponse resp)
createWebSocket in interface WebSocketCreatorprotected void doStop()
throws Exception
doStop in class ContainerLifeCycleExceptionpublic WebSocketCreator getCreator()
getCreator in interface WebSocketServletFactorypublic org.eclipse.jetty.websocket.api.extensions.ExtensionFactory getExtensionFactory()
getExtensionFactory in interface WebSocketServletFactorypublic org.eclipse.jetty.websocket.api.WebSocketPolicy getPolicy()
getPolicy in interface WebSocketServletFactorypublic void init()
throws Exception
init in interface WebSocketServletFactoryExceptionpublic boolean isUpgradeRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
isUpgradeRequest in interface WebSocketServletFactorypublic void register(Class<?> websocketPojo)
register in interface WebSocketServletFactorypublic boolean sessionClosed(WebSocketSession session)
public boolean sessionOpened(WebSocketSession session)
public void setCreator(WebSocketCreator creator)
setCreator in interface WebSocketServletFactorypublic boolean upgrade(ServletWebSocketRequest request, ServletWebSocketResponse response, EventDriver driver) throws IOException
This method will not normally return, but will instead throw a UpgradeConnectionException, to exit HTTP handling and initiate WebSocket handling of the connection.
request - The request to upgraderesponse - The response to upgradedriver - The websocket handler implementation to useIOExceptionCopyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.