Class WebsocketServer
java.lang.Object
io.openems.common.websocket.AbstractWebsocket<T>
io.openems.common.websocket.AbstractWebsocketServer<WsData>
io.openems.edge.controller.api.websocket.WebsocketServer
-
Nested Class Summary
Nested classes/interfaces inherited from class io.openems.common.websocket.AbstractWebsocketServer
AbstractWebsocketServer.DebugMode
-
Constructor Summary
ConstructorsConstructorDescriptionWebsocketServer
(WebsocketApi parent, String name, int port, int poolSize, AbstractWebsocketServer.DebugMode debugMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected WsData
Creates an empty WsData object that is attached to the WebSocket as early as possible.protected void
Execute aRunnable
using the sharedExecutorService
.protected OnClose
Callback for websocket OnClose event.protected OnError
Callback for websocket error.Callback for JSON-RPC notification.protected OnOpen
Callback for websocket OnOpen event.protected OnRequest
Callback for JSON-RPC request.protected void
Log a error message.protected void
Log a info message.protected void
Log a warn message.Methods inherited from class io.openems.common.websocket.AbstractWebsocketServer
broadcastMessage, getConnections, getOnInternalError, getPort, handleNonJsonrpcMessage, sendMessage, start, stop
Methods inherited from class io.openems.common.websocket.AbstractWebsocket
getName, handleInternalErrorAsync, handleInternalErrorSync
-
Constructor Details
-
WebsocketServer
public WebsocketServer(WebsocketApi parent, String name, int port, int poolSize, AbstractWebsocketServer.DebugMode debugMode)
-
-
Method Details
-
createWsData
Description copied from class:AbstractWebsocket
Creates an empty WsData object that is attached to the WebSocket as early as possible.- Specified by:
createWsData
in classAbstractWebsocket<WsData>
- Returns:
- the typed
WsData
-
getOnOpen
Description copied from class:AbstractWebsocket
Callback for websocket OnOpen event.- Specified by:
getOnOpen
in classAbstractWebsocket<WsData>
- Returns:
- the
OnOpen
callback
-
getOnRequest
Description copied from class:AbstractWebsocket
Callback for JSON-RPC request.- Specified by:
getOnRequest
in classAbstractWebsocket<WsData>
- Returns:
- the
OnRequest
callback
-
getOnNotification
Description copied from class:AbstractWebsocket
Callback for JSON-RPC notification.- Specified by:
getOnNotification
in classAbstractWebsocket<WsData>
- Returns:
- the
OnNotification
callback
-
getOnError
Description copied from class:AbstractWebsocket
Callback for websocket error.- Specified by:
getOnError
in classAbstractWebsocket<WsData>
- Returns:
- the
OnError
callback
-
getOnClose
Description copied from class:AbstractWebsocket
Callback for websocket OnClose event.- Specified by:
getOnClose
in classAbstractWebsocket<WsData>
- Returns:
- the
OnClose
callback
-
logInfo
Description copied from class:AbstractWebsocket
Log a info message.- Specified by:
logInfo
in classAbstractWebsocket<WsData>
- Parameters:
log
- a Logger instancemessage
- the message
-
logWarn
Description copied from class:AbstractWebsocket
Log a warn message.- Specified by:
logWarn
in classAbstractWebsocket<WsData>
- Parameters:
log
- a Logger instancemessage
- the message
-
logError
Description copied from class:AbstractWebsocket
Log a error message.- Specified by:
logError
in classAbstractWebsocket<WsData>
- Parameters:
log
- a Logger instancemessage
- the message
-
execute
Description copied from class:AbstractWebsocketServer
Execute aRunnable
using the sharedExecutorService
.- Overrides:
execute
in classAbstractWebsocketServer<WsData>
- Parameters:
command
- theRunnable
- Throws:
RejectedExecutionException
-