public class WebRxSseServerTransportProvider.WebRxMcpSessionTransport extends java.lang.Object implements McpServerTransport
构造器和说明 |
---|
WebRxMcpSessionTransport(org.noear.solon.core.handle.Context context,
reactor.core.publisher.FluxSink<org.noear.solon.web.sse.SseEvent> sink) |
限定符和类型 | 方法和说明 |
---|---|
void |
close()
Closes the transport connection and releases any associated resources.
|
reactor.core.publisher.Mono<java.lang.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<java.lang.Void> |
sendMessage(McpSchema.JSONRPCMessage message)
Sends a message to the peer asynchronously.
|
<T> T |
unmarshalFrom(java.lang.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, wait
connect
public 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<java.lang.Void> sendMessage(McpSchema.JSONRPCMessage message)
McpTransport
This 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
在接口中 McpTransport
message
- the McpSchema.JSONRPCMessage
to be sent to the serverMono
that completes when the message has been sentpublic <T> T unmarshalFrom(java.lang.Object data, com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
McpTransport
unmarshalFrom
在接口中 McpTransport
T
- the type of the object to unmarshaldata
- the data to unmarshaltypeRef
- the type reference for the object to unmarshalpublic reactor.core.publisher.Mono<java.lang.Void> closeGracefully()
McpTransport
closeGracefully
在接口中 McpTransport
Mono
that completes when the connection has been closed.public void close()
McpTransport
This method ensures proper cleanup of resources when the transport is no longer needed. It should handle the graceful shutdown of any active connections.
close
在接口中 McpTransport