|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.util.component.AbstractLifeCycle org.eclipse.jetty.websocket.WebSocketFactory
public class WebSocketFactory
Factory to create WebSocket connections
Nested Class Summary | |
---|---|
static interface |
WebSocketFactory.Acceptor
|
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.LifeCycle |
---|
LifeCycle.Listener |
Field Summary |
---|
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
Constructor Summary | |
---|---|
WebSocketFactory(WebSocketFactory.Acceptor acceptor)
|
|
WebSocketFactory(WebSocketFactory.Acceptor acceptor,
int bufferSize)
|
Method Summary | |
---|---|
boolean |
acceptWebSocket(HttpServletRequest request,
HttpServletResponse response)
|
protected boolean |
addConnection(WebSocketServletConnection connection)
|
protected void |
closeConnections()
|
protected void |
doStop()
|
int |
getBufferSize()
Get the bufferSize. |
Map<String,Class<? extends Extension>> |
getExtensionClassesMap()
|
int |
getMaxBinaryMessageSize()
|
long |
getMaxIdleTime()
Get the maxIdleTime. |
int |
getMaxTextMessageSize()
|
List<Extension> |
initExtensions(List<String> requested,
int maxDataOpcodes,
int maxControlOpcodes,
int maxReservedBits)
|
protected String[] |
parseProtocols(String protocol)
|
protected boolean |
removeConnection(WebSocketServletConnection connection)
|
void |
setBufferSize(int bufferSize)
Set the bufferSize. |
void |
setMaxBinaryMessageSize(int maxBinaryMessageSize)
Set the initial maximum binary message size for a connection. |
void |
setMaxIdleTime(int maxIdleTime)
Set the maxIdleTime. |
void |
setMaxTextMessageSize(int maxTextMessageSize)
Set the initial maximum text message size for a connection. |
void |
upgrade(HttpServletRequest request,
HttpServletResponse response,
WebSocket websocket,
String protocol)
Upgrade the request/response to a WebSocket Connection. |
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
---|
addLifeCycleListener, doStart, getState, getState, 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 |
Constructor Detail |
---|
public WebSocketFactory(WebSocketFactory.Acceptor acceptor)
public WebSocketFactory(WebSocketFactory.Acceptor acceptor, int bufferSize)
Method Detail |
---|
public Map<String,Class<? extends Extension>> getExtensionClassesMap()
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 int getMaxTextMessageSize()
public void setMaxTextMessageSize(int maxTextMessageSize)
WebSocket.Connection.setMaxTextMessageSize(int)
.
maxTextMessageSize
- The default maximum text message size (in characters) for a connectionpublic int getMaxBinaryMessageSize()
public void setMaxBinaryMessageSize(int maxBinaryMessageSize)
WebSocket.Connection.setMaxBinaryMessageSize(int)
.
maxBinaryMessageSize
- The default maximum binary message size (in bytes) for a connectionprotected void doStop() throws Exception
doStop
in class AbstractLifeCycle
Exception
public void upgrade(HttpServletRequest request, HttpServletResponse response, WebSocket websocket, 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 useprotocol
- The websocket protocol
IOException
- in case of I/O errorsprotected String[] parseProtocols(String protocol)
public boolean acceptWebSocket(HttpServletRequest request, HttpServletResponse response) throws IOException
IOException
public List<Extension> initExtensions(List<String> requested, int maxDataOpcodes, int maxControlOpcodes, int maxReservedBits)
protected boolean addConnection(WebSocketServletConnection connection)
protected boolean removeConnection(WebSocketServletConnection connection)
protected void closeConnections()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |