2.2.3 Enterprise Beanのライフサイクル

Enterprise Beanのライフサイクルについて,Enterprise Beanの種類ごとに説明します。

<この項の構成>
(1) Session Beanのライフサイクル
(2) Entity Beanのライフサイクル
(3) Message-driven Beanのライフサイクル

(1) Session Beanのライフサイクル

Session Beanのライフサイクルは,Stateless Session Beanの場合とStateful Session Beanの場合とで異なります。

(a) Stateless Session Beanの場合

Stateless Session Beanのライフサイクルを次の図に示します。

図2-1 Stateless Session Beanのライフサイクル

[図データ]

does not exist:
Stateless Session Beanが存在しない状態
method-ready pool:
Stateless Session Beanが実行可能状態としてmethod-readyプール内に存在する状態
(b) Stateful Session Beanの場合

Stateful Session Beanのライフサイクルを次の図に示します。

図2-2 Stateful Session Beanのライフサイクル

[図データ]

does not exist:
Stateful Session Beanが存在しない状態
method-ready:
Stateful Session Beanがアクティベイトされ,実行可能状態としてmethod-readyプール内に存在する状態(トランザクションなし)
method-ready in TX:
Stateful Session Beanがアクティベイトされ,実行可能状態としてmethod-readyプール内に存在する状態(トランザクションあり)

(2) Entity Beanのライフサイクル

Entity Beanのライフサイクルを次の図に示します。

図2-3 Entity Beanのライフサイクル

[図データ]

does not exist:
Entity Beanが存在しない状態
pool:
Entity Beanがパッシベイトされ,passiveプール内に存在する状態
ready:
Entity Beanがアクティベイトされ,readyプール内に存在する状態

(3) Message-driven Beanのライフサイクル

Message-driven Beanのライフサイクルを次の図に示します。

図2-4 Message-driven Beanのライフサイクル

[図データ]

does not exist:
Message-driven Beanが存在しない状態
method-ready pool:
Message-driven Beanがmethod-ready状態で,ServerSessionプール内に存在する状態