类:LiveWebSocketHandler
java.lang.Object
org.springframework.web.socket.handler.AbstractWebSocketHandler
org.springframework.web.socket.handler.TextWebSocketHandler
com.google.adk.web.websocket.LiveWebSocketHandler
- All Implemented Interfaces:
org.springframework.web.socket.WebSocketHandler
@Component
public class LiveWebSocketHandler
extends org.springframework.web.socket.handler.TextWebSocketHandler
用于 `/run_live` 端点的 WebSocket 处理程序。
负责管理实时客服交互中的双向通信。假设 `com.google.adk.runner.Runner` 类中有一个名为 `run` 的方法: public Flowable<Event> runLive(Session
session, Flowable<LiveRequest> liveRequests, List<String> modalities)
-
构造函数概述
ConstructorsConstructorDescriptionLiveWebSocketHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, BaseSessionService sessionService, RunnerService runnerService) -
方法概述
Modifier and TypeMethodDescriptionvoidafterConnectionClosed(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.CloseStatus status) voidafterConnectionEstablished(org.springframework.web.socket.WebSocketSession wsSession) protected voidhandleTextMessage(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.TextMessage message) voidhandleTransportError(org.springframework.web.socket.WebSocketSession wsSession, Throwable exception) Methods inherited from class org.springframework.web.socket.handler.TextWebSocketHandler
handleBinaryMessageMethods inherited from class org.springframework.web.socket.handler.AbstractWebSocketHandler
handleMessage, handlePongMessage, supportsPartialMessages
-
构造函数详细信息
-
LiveWebSocketHandler
@Autowired public LiveWebSocketHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, BaseSessionService sessionService, RunnerService runnerService)
-
-
方法详细信息(Method Details)
-
afterConnectionEstablished
public void afterConnectionEstablished(org.springframework.web.socket.WebSocketSession wsSession) throws Exception - Specified by:
afterConnectionEstablishedin interfaceorg.springframework.web.socket.WebSocketHandler- Overrides:
afterConnectionEstablishedin classorg.springframework.web.socket.handler.AbstractWebSocketHandler- Throws:
Exception
-
handleTextMessage
-
handleTransportError
public void handleTransportError(org.springframework.web.socket.WebSocketSession wsSession, Throwable exception) throws Exception - Specified by:
handleTransportErrorin interfaceorg.springframework.web.socket.WebSocketHandler- Overrides:
handleTransportErrorin classorg.springframework.web.socket.handler.AbstractWebSocketHandler- Throws:
Exception
-
afterConnectionClosed
public void afterConnectionClosed(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.CloseStatus status) throws Exception - Specified by:
afterConnectionClosedin interfaceorg.springframework.web.socket.WebSocketHandler- Overrides:
afterConnectionClosedin classorg.springframework.web.socket.handler.AbstractWebSocketHandler- Throws:
Exception
-