public class WebRxSseServerTransportProvider.WebRxMcpSessionTransport extends Object implements McpServerTransport
| Constructor and Description |
|---|
WebRxMcpSessionTransport(org.noear.solon.core.handle.Context context,
reactor.core.publisher.FluxSink<org.noear.solon.web.sse.SseEvent> sink) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the transport connection and releases any associated resources.
|
reactor.core.publisher.Mono<Void> |
closeGracefully()
Closes the transport connection and releases any associated resources
asynchronously.
|
org.noear.solon.core.handle.Context |
getContext() |
void |
sendHeartbeat() |
reactor.core.publisher.Mono<Void> |
sendMessage(McpSchema.JSONRPCMessage message)
Sends a message to the peer asynchronously.
|
<T> T |
unmarshalFrom(Object data,
com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
Unmarshals the given data into an object of the specified type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectpublic WebRxMcpSessionTransport(org.noear.solon.core.handle.Context context,
reactor.core.publisher.FluxSink<org.noear.solon.web.sse.SseEvent> sink)
public org.noear.solon.core.handle.Context getContext()
public void sendHeartbeat()
public reactor.core.publisher.Mono<Void> sendMessage(McpSchema.JSONRPCMessage message)
McpTransportThis method handles the transmission of messages to the server in an asynchronous manner. Messages are sent in JSON-RPC format as specified by the MCP protocol.
sendMessage in interface McpTransportmessage - the McpSchema.JSONRPCMessage to be sent to the serverMono that completes when the message has been sentpublic <T> T unmarshalFrom(Object data, com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
McpTransportunmarshalFrom in interface McpTransportT - the type of the object to unmarshaldata - the data to unmarshaltypeRef - the type reference for the object to unmarshalpublic reactor.core.publisher.Mono<Void> closeGracefully()
McpTransportcloseGracefully in interface McpTransportMono that completes when the connection has been closed.public void close()
McpTransportThis method ensures proper cleanup of resources when the transport is no longer needed. It should handle the graceful shutdown of any active connections.
close in interface McpTransportCopyright © 2025. All rights reserved.