Bean (beans)

beans 端點提供關於應用程式 bean 的資訊。

檢索 Bean

要檢索 bean,請向 /actuator/beans 發出 GET 請求,如以下基於 curl 的示例所示

$ curl 'https://:8080/actuator/beans' -i -X GET

結果響應類似於以下內容

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

{
  "contexts" : {
    "application" : {
      "beans" : {
        "org.springframework.boot.webmvc.autoconfigure.actuate.web.WebMvcEndpointManagementContextConfiguration" : {
          "aliases" : [ ],
          "dependencies" : [ ],
          "scope" : "singleton",
          "type" : "org.springframework.boot.webmvc.autoconfigure.actuate.web.WebMvcEndpointManagementContextConfiguration"
        },
        "org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration" : {
          "aliases" : [ ],
          "dependencies" : [ ],
          "scope" : "singleton",
          "type" : "org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration"
        },
        "org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration" : {
          "aliases" : [ ],
          "dependencies" : [ ],
          "scope" : "singleton",
          "type" : "org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration"
        }
      }
    }
  }
}

響應結構

響應包含應用程式 bean 的詳細資訊。下表描述了響應的結構

路徑 型別 描述

contexts

物件

按 ID 鍵控的應用程式上下文。

contexts.*.parentId

字串

父應用程式上下文的 ID(如果有)。

contexts.*.beans

物件

應用程式上下文中按名稱鍵控的 bean。

contexts.*.beans.*.aliases

陣列

任何別名的名稱。

contexts.*.beans.*.scope

字串

bean 的作用域。

contexts.*.beans.*.type

字串

bean 的完全限定型別。

contexts.*.beans.*.resource

字串

定義 bean 的資源(如果有)。

contexts.*.beans.*.dependencies

陣列

任何依賴項的名稱。

© . This site is unofficial and not affiliated with VMware.