Overall architecture of Tomcat (Catalina)

Overall view of Catalina

Tomcat's Servlet container, Catalina, consists of Server, Service, Engine, Host, Context, and Warpper. The parent-child relationship and overall view of each component are as follows. In the figure, overlapping components indicate the multiplicity with respect to the parent component. For example, a Server has one or more Services, and a Service has one or more Connectors and one Engine.

A rough description of each component

Server / Service component

** Server ** is a component of the Tomcat instance itself. Has one or more Services, Global Naming Resources, Listeners. Global Naming Resources can be referenced from the entire Tomcat using JNDI.

** Service ** is a component that processes requests from the outside. It has one Engine and one or more Connector. The Connector accepts the request and the container (Engine) executes the request. It has a Connector that supports the AJP protocol as the back end of HTTP and Apache HTTPD when running Tomcat as a Web server, and the Coyote Adapter connects the connector and Engine for each protocol.

Conttectorアーキテクチャ.png

Container components (Engine, Host, Context, Wrapper)

The Engine, Host, Context, and Wrapper are called container components and make up the core components of the Servrrt engine. Engine processes / returns the request received from Connector. The basic explanation of the components (Engine, Host, Context, Wrapper) that make up the container is as follows.

--Engine: Process / return the request received from the Connector held by the parent service.

--Host: Indicates the virtual host in the Engine.

--Context: Indicates a web application running inside a virtual host. One-to-one correspondence with Web applications.

--Wrapper: Corresponds to one Servlet in the web application. One-to-one correspondence with Servlet instances.

(In the middle of writing)

Recommended Posts

Overall architecture of Tomcat (Catalina)
ArchUnit Practice: Architecture Testing of Onion Architecture
Implementation of asynchronous processing in Tomcat