Class SyncMcpLogginProvider
java.lang.Object
org.springaicommunity.mcp.provider.logging.SyncMcpLogginProvider
Deprecated.
Provider for synchronous logging consumer callbacks.
This class scans a list of objects for methods annotated with McpLogging and
creates Consumer callbacks for them. These callbacks can be used to handle
logging message notifications from MCP servers.
Example usage:
// Create a provider with a list of objects containing @McpLoggingConsumer methods
SyncMcpLoggingConsumerProvider provider = new SyncMcpLoggingConsumerProvider(List.of(loggingHandler));
// Get the list of logging consumer callbacks
List<Consumer<LoggingMessageNotification>> consumers = provider.getLoggingConsumers();
// Add the consumers to the client features
McpClientFeatures.Sync clientFeatures = new McpClientFeatures.Sync(
clientInfo, clientCapabilities, roots,
toolsChangeConsumers, resourcesChangeConsumers, promptsChangeConsumers,
consumers, samplingHandler);
- Author:
- Christian Tzolov
- See Also:
-
McpLoggingSyncMcpLoggingMethodCallbackMcpSchema.LoggingMessageNotification
-
Constructor Summary
ConstructorsConstructorDescriptionSyncMcpLogginProvider(List<Object> loggingConsumerObjects) Deprecated.Create a new SyncMcpLoggingConsumerProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected Method[]doGetClassMethods(Object bean) Deprecated.Returns the methods of the given bean class.Deprecated.Get the list of logging consumer callbacks.
-
Constructor Details
-
SyncMcpLogginProvider
Deprecated.Create a new SyncMcpLoggingConsumerProvider.- Parameters:
loggingConsumerObjects- the objects containing methods annotated withMcpLogging
-
-
Method Details
-
getLoggingSpecifications
Deprecated.Get the list of logging consumer callbacks.- Returns:
- the list of logging consumer callbacks
-
doGetClassMethods
Deprecated.Returns the methods of the given bean class.- Parameters:
bean- the bean instance- Returns:
- the methods of the bean class
-
SyncMcpLoggingProviderinstead.