public class WebSocketImpl extends Object implements WebSocket
WebSocket.Callback<T>, WebSocket.CloseStatus, WebSocket.Definition, WebSocket.ErrCallback, WebSocket.Handler, WebSocket.SuccessCallback
BAD_DATA, ERR, GOING_AWAY, NORMAL, NOT_ACCEPTABLE, POLICY_VIOLATION, PROTOCOL_ERROR, REQUIRED_EXTENSION, SERVER_ERROR, SERVICE_OVERLOAD, SERVICE_RESTARTED, SUCCESS, TOO_BIG_TO_PROCESS
Constructor and Description |
---|
WebSocketImpl(WebSocket.Handler handler,
String path,
String pattern,
Map<Object,String> vars,
MediaType consumes,
MediaType produces) |
Modifier and Type | Method and Description |
---|---|
void |
close(WebSocket.CloseStatus status)
Gracefully closes the connection, after sending a description message
|
void |
connect(com.google.inject.Injector injector,
NativeWebSocket ws) |
MediaType |
consumes() |
void |
onClose(WebSocket.Callback<WebSocket.CloseStatus> callback)
Register an close callback to execute when client close the web socket.
|
void |
onError(WebSocket.ErrCallback callback)
Register an error callback to execute when an error is found.
|
void |
onMessage(WebSocket.Callback<Mutant> callback)
Register a callback to execute when a new message arrive.
|
String |
path() |
String |
pattern() |
void |
pause()
Pause the client stream.
|
MediaType |
produces() |
<T> T |
require(com.google.inject.Key<T> key)
Find and return a service using the provided key.
|
void |
resume()
Resume the client stream.
|
void |
send(Object data,
WebSocket.SuccessCallback success,
WebSocket.ErrCallback err)
Send data through the connection.
|
void |
terminate()
Immediately shuts down the connection.
|
String |
toString() |
Map<Object,String> |
vars() |
public void close(WebSocket.CloseStatus status)
WebSocket
public void resume()
WebSocket
public void pause()
WebSocket
public void terminate() throws Exception
WebSocket
public void send(Object data, WebSocket.SuccessCallback success, WebSocket.ErrCallback err) throws Exception
WebSocket
public void onMessage(WebSocket.Callback<Mutant> callback) throws Exception
WebSocket
public void connect(com.google.inject.Injector injector, NativeWebSocket ws)
public String pattern()
public MediaType consumes()
public MediaType produces()
public <T> T require(com.google.inject.Key<T> key)
WebSocket
public void onError(WebSocket.ErrCallback callback)
WebSocket
public void onClose(WebSocket.Callback<WebSocket.CloseStatus> callback) throws Exception
WebSocket
Copyright © 2015. All rights reserved.