|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.websocket.WebSocketFactory
public class WebSocketFactory
Factory to create WebSocket connections
Nested Class Summary | |
---|---|
static interface |
WebSocketFactory.Acceptor
|
Constructor Summary | |
---|---|
WebSocketFactory(WebSocketFactory.Acceptor acceptor)
|
|
WebSocketFactory(WebSocketFactory.Acceptor acceptor,
int bufferSize)
|
Method Summary | |
---|---|
boolean |
acceptWebSocket(HttpServletRequest request,
HttpServletResponse response)
|
int |
getBufferSize()
Get the bufferSize. |
long |
getMaxIdleTime()
Get the maxIdleTime. |
static String[] |
parseProtocols(String protocol)
|
void |
setBufferSize(int bufferSize)
Set the bufferSize. |
void |
setMaxIdleTime(int maxIdleTime)
Set the maxIdleTime. |
void |
upgrade(HttpServletRequest request,
HttpServletResponse response,
WebSocket websocket,
String origin,
String protocol)
Upgrade the request/response to a WebSocket Connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebSocketFactory(WebSocketFactory.Acceptor acceptor)
public WebSocketFactory(WebSocketFactory.Acceptor acceptor, int bufferSize)
Method Detail |
---|
public long getMaxIdleTime()
public void setMaxIdleTime(int maxIdleTime)
maxIdleTime
- the maxIdleTime to setpublic int getBufferSize()
public void setBufferSize(int bufferSize)
bufferSize
- the bufferSize to setpublic void upgrade(HttpServletRequest request, HttpServletResponse response, WebSocket websocket, String origin, String protocol) 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 upgradewebsocket
- The websocket handler implementation to useorigin
- The origin of the websocket connectionprotocol
- The websocket protocol
IOException
- in case of I/O errorspublic static String[] parseProtocols(String protocol)
public boolean acceptWebSocket(HttpServletRequest request, HttpServletResponse response) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |