Bean (beans)

beans エンドポイントは、アプリケーションの Bean に関する情報を提供します。

Bean の取得

Bean を取得するには、次の curl ベースの例に示すように、GET リクエストを /actuator/beans に作成します。

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

結果のレスポンスは次のようになります。

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" : [ ]
        }
      }
    }
  }
}

レスポンス構造

レスポンスには、アプリケーションの Bean の詳細が含まれます。次の表に、レスポンスの構造を示します。

パス タイプ 説明

contexts

Object

ID をキーとするアプリケーションコンテキスト。

contexts.*.parentId

String

親アプリケーションコンテキストの ID(存在する場合)。

contexts.*.beans

Object

名前をキーとするアプリケーションコンテキストの Bean。

contexts.*.beans.*.aliases

Array

エイリアスの名前。

contexts.*.beans.*.scope

String

Bean の範囲。

contexts.*.beans.*.type

String

Bean の完全修飾型。

contexts.*.beans.*.resource

String

Bean が定義されたリソース(ある場合)。

contexts.*.beans.*.dependencies

Array

依存関係の名前。