22
25

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Tomcat(Catalina)のアーキテクチャ全体図

Last updated at Posted at 2019-04-06

Catalinaの全体図

Tomcatのサーブレットコンテナ、CatalinaはServer、Service、Engine、Host、Context、Warpperで構成される。それぞれのコンポーネントの親子関係・全体図は下の通り。
図中、重なりがあるコンポーネントは親コンポーネントに対しての多重度を示す。
例えば、Serverは1つ以上のServiceを持ち、Serviceは1つ以上のConnectorと1つのEngineを持つ。

※図中のValueは「Valve」の間違いです!手が空いたときに訂正します!
全体図.png

各コンポーネントのざっくりした説明

Server・Serviceコンポーネント

ServerはTomcatインスタンス自体のコンポーネント。1つ以上のService、Global Naming Resources、Listenerを持つ。Global Naming ResourcesはJNDIを用いてTomcat全体から参照可能。

Serviceは外部からのリクエスト処理を行うコンポーネント。1つのEngineと1つ以上のConnectorを持つ。Connectorがリクエストを受付け、コンテナ(Engine)がリクエストの実行を行う。WebサーバとしてTomcatを実行する際のHTTP、Apache HTTPDのバックエンドとしてのAJPプロトコルに対応したConnectorを持ち、CoyoteAdapterが各プロトコルごとのコネクターとEngineを連結させる。

Conttectorアーキテクチャ.png

コンテナコンポーネント(Engine、Host、Context、Wrapper)

Engine、Host、Context、Wrapperはコンテナコンポーネントと呼ばれ、Servlrtエンジンのコアコンポーネントを構成する。EngineはConnectorから受け取ったリクエストを処理/レスポンスを返す。コンテナを構成するコンポーネント(Engine、Host、Context、Wrapper)の基本的な説明は以下の通り。

  • Engine :親サービスが保持するConnectorから受け取ったリクエストを処理/リクエストを返す。

  • Host :Engine内の仮想ホストを示す。

  • Context:仮想ホスト内で実行されるWebアプリケーションを示す。Webアプリケーションと1対1に対応する。

  • Wrapper:Webアプリケーション内のServlet1つに対応する。Servletのインスタンスと1対1に対応する。

(書き途中)

22
25
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
25

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?