跳到主要内容

Beans (beans)

DeepSeek V3 中英对照 Beans (beans)

beans 端点提供了有关应用程序的 beans 的信息。

获取 Beans

要获取 beans,请向 /actuator/beans 发起一个 GET 请求,如下面的基于 curl 的示例所示:

$ curl 'http://localhost:8080/actuator/beans' -i -X GET
bash

生成的响应类似于以下内容:

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 1089

{
"contexts" : {
"application" : {
"beans" : {
"org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration" : {
"aliases" : [ ],
"scope" : "singleton",
"type" : "org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration",
"dependencies" : [ ]
},
"org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration" : {
"aliases" : [ ],
"scope" : "singleton",
"type" : "org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration",
"dependencies" : [ ]
},
"org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration" : {
"aliases" : [ ],
"scope" : "singleton",
"type" : "org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration",
"dependencies" : [ ]
}
}
}
}
}
http

响应结构

响应中包含了应用程序的 bean 的详细信息。下表描述了响应的结构:

路径类型描述
contextsObject按 id 键控的应用上下文。
contexts.*.parentIdString父应用上下文的 id(如果有)。
contexts.*.beansObject应用上下文中的 bean,按名称键控。
contexts.*.beans.*.aliasesArray任何别名的名称。
contexts.*.beans.*.scopeStringbean 的作用域。
contexts.*.beans.*.typeStringbean 的完全限定类型。
contexts.*.beans.*.resourceString定义 bean 的资源(如果有)。
contexts.*.beans.*.dependenciesArray任何依赖项的名称。