|
8 | 8 | import io.modelcontextprotocol.util.McpServiceLoader; |
9 | 9 |
|
10 | 10 | /** |
11 | | - * This class is to be used to provide access to the default McpJsonMapper and to the |
12 | | - * default JsonSchemaValidator instances via the static methods: getMapper and |
13 | | - * getSchemaValidator. |
| 11 | + * This class is to be used to provide access to the default {@link McpJsonMapper} and to |
| 12 | + * the default {@link JsonSchemaValidator} instances via the static methods: |
| 13 | + * {@link #getMapper()} and {@link #getSchemaValidator()}. |
14 | 14 | * <p> |
15 | 15 | * The initialization of (singleton) instances of this class is different in non-OSGi |
16 | | - * environments and OSGi environments. Specifically, in non-OSGi environments The |
17 | | - * McpJsonDefaults class will be loaded by whatever classloader is used to call one of the |
18 | | - * existing static get methods for the first time. For servers, this will usually be in |
19 | | - * response to the creation of the first McpServer instance. At that first time, the |
20 | | - * mcpMapperServiceLoader and mcpValidatorServiceLoader will be null, and the |
21 | | - * McpJsonDefaults constructor will be called, creating/initializing the |
22 | | - * mcpMapperServiceLoader and the mcpValidatorServiceLoader...which will then be used to |
23 | | - * call the ServiceLoader.load method. |
| 16 | + * environments and OSGi environments. Specifically, in non-OSGi environments the |
| 17 | + * {@code McpJsonDefaults} class will be loaded by whatever classloader is used to call |
| 18 | + * one of the existing static get methods for the first time. For servers, this will |
| 19 | + * usually be in response to the creation of the first {@code McpServer} instance. At that |
| 20 | + * first time, the {@code mcpMapperServiceLoader} and {@code mcpValidatorServiceLoader} |
| 21 | + * will be null, and the {@code McpJsonDefaults} constructor will be called, |
| 22 | + * creating/initializing the {@code mcpMapperServiceLoader} and the |
| 23 | + * {@code mcpValidatorServiceLoader}...which will then be used to call the |
| 24 | + * {@code ServiceLoader.load} method. |
24 | 25 | * <p> |
25 | 26 | * In OSGi environments, upon bundle activation SCR will create a new (singleton) instance |
26 | | - * of McpJsonDefaults (via the constructor), and then inject suppliers via the |
27 | | - * setMcpJsonMapperSupplier and setJsonSchemaValidatorSupplier methods with the |
28 | | - * SCR-discovered instances of those services. This does depend upon the jars/bundles |
29 | | - * providing those suppliers to be started/activated. This SCR behavior is dictated by xml |
30 | | - * files in OSGi-INF directory of mcp-core (this project/jar/bundle), and the jsonmapper |
31 | | - * and jsonschemvalidator provider jars/bundles (e.g. mcp-json-jackson2, 3, or others). |
| 27 | + * of {@code McpJsonDefaults} (via the constructor), and then inject suppliers via the |
| 28 | + * {@code setMcpJsonMapperSupplier} and {@code setJsonSchemaValidatorSupplier} methods |
| 29 | + * with the SCR-discovered instances of those services. This does depend upon the |
| 30 | + * jars/bundles providing those suppliers to be started/activated. This SCR behavior is |
| 31 | + * dictated by xml files in {@code OSGi-INF} directory of {@code mcp-core} (this |
| 32 | + * project/jar/bundle), and the jsonmapper and jsonschemavalidator provider jars/bundles |
| 33 | + * (e.g. {@code mcp-json-jackson2}, {@code mcp-json-jackson3}, or others). |
32 | 34 | */ |
33 | 35 | public class McpJsonDefaults { |
34 | 36 |
|
|
0 commit comments