Tomcat system architecture and design pattern, part 1th: Working principle

Source: Internet
Author: User
Tags tomcat

Based on Tomcat 5, this article also takes into account the latest Tomcat 6 and Tomcat 4. Tomcat's basic design ideas and architectures are of a certain continuity.

TOMCAT Overall structure

Tomcat's structure is very complex, but Tomcat is also very modular, and found the core of Tomcat module, you captured Tomcat's "seven". The following is the overall structure diagram of Tomcat:

Overall structure of Figure 1.Tomcat

As you can see from the image above, Tomcat's heart is two components: Connector and Container, which are described in detail later. The Connector component can be replaced so that it gives the server designer more choice, because this component is so important that it is not only relevant to the design of the server itself, but also to the different scenarios, so a Container can choose to correspond to multiple Connector. Multiple Connector and a Container on the formation of a service,service concept everyone is very familiar with the service can provide external services, but the service also needs a living environment, must have someone to give her life, master its health The death of power, that is not the Server mo. So the entire Tomcat lifecycle is controlled by the Server.

Service as a "marriage"

We compare Tomcat Connector, Container as a whole to a couple, Connector mainly responsible for external communication, can be likened to Boy, Container mainly deal with Connector accepted requests, mainly to deal with internal affairs, Can be likened to Girl. So this Service is to connect the men and women's marriage license. It is the Service that connects them together to form a family. Of course, it takes a lot of other elements to make up a family.

To put it bluntly, service is just a Connector and Container outside a layer, assembled them together, to provide services outside, a service can set up multiple Connector, but only one Container container. The list of methods for this Service interface is as follows:

Figure 2. Service interface

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.