Class JenkinsMcpContext
java.lang.Object
io.jenkins.plugins.mcp.server.tool.JenkinsMcpContext
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Clears the JenkinsMcpContext for the current thread to prevent memory leaks.static JenkinsMcpContextget()Gets the JenkinsMcpContext for the current thread.
-
Constructor Details
-
JenkinsMcpContext
public JenkinsMcpContext()
-
-
Method Details
-
get
Gets the JenkinsMcpContext for the current thread. Creates a new one if it doesn't exist.- Returns:
- The thread-local JenkinsMcpContext instance.
-
close
Clears the JenkinsMcpContext for the current thread to prevent memory leaks.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-