5.3. ランタイム Bean デプロイメント情報

ランタイムメタデータは Bean デプロイメントから利用できるため、Bean のパフォーマンスを監視できます。

ランタイムメタデータは、次のタイプの Bean で使用できます。

  • ステートフルセッション Bean
  • ステートレスセッション Bean
  • シングルトンビーンズ
  • メッセージ駆動 Bean

Bean アプリケーションには、コードまたはデプロイメント記述子にアノテーションとしてメタデータが含まれています。アプリケーションは両方のオプションを使用できます。使用可能なランタイムデータの詳細については、JBoss EAP 管理モデルの ejb3 サブシステムを参照してください。

関連情報

5.3.1. Jakarta Enterprise Beans からランタイムデータを取得するためのコマンドラインオプション

Jakarta Enterprise Beans のランタイムデータは管理 CLI から利用できるため、Jakarta Enterprise Beans のパフォーマンスを評価できます。

すべてのタイプの Bean のランタイムデータを取得するコマンドは、次のパターンを使用します。

/deployment=<deployment_name>/subsystem=ejb3/<bean_type>=<bean_name>:read-resource(include-runtime)

<deployment_name> を、ランタイムデータを取得するデプロイメント .jar ファイルの名前に置き換えます。<bean_type> を、ランタイムデータを取得する Bean のタイプに置き換えます。このプレースホルダーには、次のオプションが有効です。

  • stateless-session-bean
  • stateful-session-bean
  • singleton-bean
  • message-driven-bean

<bean_name> を、ランタイムデータを取得する Bean の名前に置き換えます。

システムは、Java Script Object Notation (JSON) データとしてフォーマットされた stdout に結果を配信します。

ejb-management.jar という名前のファイルにデプロイされた ManagedSingletonBean という名前のシングルトン Bean のランタイムデータを取得するコマンドの例

/deployment=ejb-management.jar/subsystem=ejb3/singleton-bean=ManagedSingletonBean:read-resource(include-runtime)

シングルトン Bean の出力ランタイムデータの例

{
    "outcome" => "success",
    "result" => {
        "async-methods" => ["void async(int, int)"],
        "business-local" => ["sample.ManagedSingletonBean"],
        "business-remote" => ["sample.BusinessInterface"],
        "component-class-name" => "sample.ManagedSingletonBean",
        "concurrency-management-type" => undefined,
        "declared-roles" => [
            "Role3",
            "Role2",
            "Role1"
        ],
        "depends-on" => undefined,
        "execution-time" => 156L,
        "init-on-startup" => false,
        "invocations" => 3L,
        "jndi-names" => [
            "java:module/ManagedSingletonBean!sample.ManagedSingletonBean",
            "java:global/ejb-management/ManagedSingletonBean!sample.ManagedSingletonBean",
            "java:app/ejb-management/ManagedSingletonBean!sample.ManagedSingletonBean",
            "java:app/ejb-management/ManagedSingletonBean!sample.BusinessInterface",
            "java:global/ejb-management/ManagedSingletonBean!sample.BusinessInterface",
            "java:module/ManagedSingletonBean!sample.BusinessInterface"
        ],
        "methods" => {"doIt" => {
            "execution-time" => 156L,
            "invocations" => 3L,
            "wait-time" => 0L
        }},
        "peak-concurrent-invocations" => 1L,
        "run-as-role" => "Role3",
        "security-domain" => "other",
        "timeout-method" => "public void sample.ManagedSingletonBean.timeout(javax.ejb.Timer)",
        "timers" => [{
            "time-remaining" => 4304279L,
            "next-timeout" => 1577768415000L,
            "calendar-timer" => true,
            "persistent" => false,
            "info" => "timer1",
            "schedule" => {
                "year" => "*",
                "month" => "*",
                "day-of-month" => "*",
                "day-of-week" => "*",
                "hour" => "0",
                "minute" => "0",
                "second" => "15",
                "timezone" => undefined,
                "start" => undefined,
                "end" => undefined
            }
        }],
        "transaction-type" => "CONTAINER",
        "wait-time" => 0L,
        "service" => {"timer-service" => undefined}
    }
}

ejb-management.jar という名前のファイルにデプロイされた NoTimerMDB という名前のメッセージ駆動型 Bean のランタイムデータを取得するコマンドの例

/deployment=ejb-management.jar/subsystem=ejb3/message-driven-bean=NoTimerMDB:read-resource(include-runtime)

メッセージ駆動型 Bean の出力例

{
    "outcome" => "success",
    "result" => {
        "activation-config" => [
            ("destination" => "java:/queue/NoTimerMDB-queue"),
            ("destinationType" => "javax.jms.Queue"),
            ("acknowledgeMode" => "Auto-acknowledge")
        ],
        "component-class-name" => "sample.NoTimerMDB",
        "declared-roles" => [
            "Role3",
            "Role2",
            "Role1"
        ],
        "delivery-active" => true,
        "execution-time" => 0L,
        "invocations" => 0L,
        "message-destination-link" => "queue/NoTimerMDB-queue",
        "message-destination-type" => "javax.jms.Queue",
        "messaging-type" => "javax.jms.MessageListener",
        "methods" => {},
        "peak-concurrent-invocations" => 0L,
        "pool-available-count" => 16,
        "pool-create-count" => 0,
        "pool-current-size" => 0,
        "pool-max-size" => 16,
        "pool-name" => "mdb-strict-max-pool",
        "pool-remove-count" => 0,
        "run-as-role" => "Role3",
        "security-domain" => "other",
        "timeout-method" => undefined,
        "timers" => [],
        "transaction-type" => "CONTAINER",
        "wait-time" => 0L,
        "service" => undefined
    }
}