首页  

tomcat8.5架构概述     所属分类 tomcat 浏览量 1356
https://tomcat.apache.org/tomcat-8.5-doc/architecture/overview.html


Server Service Engine Host Connector Context Wrapper

In the Tomcat world, a Server represents the whole container. 
Tomcat provides a default implementation of the Server interface which is rarely customized by users.

在Tomcat世界中,服务器代表整个容器。Tomcat提供了服务器接口的默认实现,用户很少对其进行定制。


Service is an intermediate component which lives inside a Server 
and ties one or more Connectors to exactly one Engine. 

服务是一个中间组件,它位于服务器内部,并将一个或多个连接器与一个引擎绑定在一起。

An Engine represents request processing pipeline for a specific Service. 
As a Service may have multiple Connectors, the Engine receives and processes all requests from these connectors, 
handing the response back to the appropriate connector for transmission to the client. 

引擎表示特定服务的请求处理管道。
一个服务可能有多个连接器,引擎接收并处理来自这些连接器的所有请求,将响应返回给适当的连接器,以便传输给客户端。


A Host is an association of a network name, e.g. www.codefun007.com, to the Tomcat server. 
An Engine may contain multiple hosts, and the Host element also supports network aliases 

主机关联网络名字 , 一个引擎可包含多个主机


A Connector handles communications with the client. 
There are multiple connectors available with Tomcat. 
These include the HTTP connector which is used for most HTTP traffic, 
especially when running Tomcat as a standalone server, 
and the AJP connector which implements the AJP protocol used 
when connecting Tomcat to a web server such as Apache HTTPD server. 


连接器与客户端通信, 多种连接器
http连接器用于处理http通信
AJP连接器 处理与 Apache 服务器通信

A Context represents a web application. A Host may contain multiple contexts, each with a unique path. 

一个Context表示web应用程序。主机可以包含多个Context,每个Context都有唯一的路径。


Context可以包含多个Wrapper, Wrapper 代表一个 Servlet,
负责管理一个 Servlet,包括 Servlet 的装载、初始化、执行以及资源回收。


各组件建的关系参考 server.xml 配置



<Server port="-1" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <GlobalNamingResources><Resource ... /></GlobalNamingResources>

  <Service name="Catalina">
    <Executor .../>
    <Connector port="8080" protocol="org.apache.coyote.http11.Http11Nio2Protocol" executor="tomcatThreadPool".../>  
    <Connector port="8443" SSLEnabled="true"> </Connector>  
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost"  appBase="webapps" unpackWARs="false" autoDeploy="false">
        <Valve className="org.apache.catalina.valves.AccessLogValve" ... />
        <Context path="/" docBase="/Users/dugang/fun/hellocode/project/tomcatdebug/src/main/webapp/" reloadable="true"> </Context>
      </Host>
    </Engine>
    
  </Service>
</Server>



上一篇     下一篇
tomcat8.5压测记录

tomcat8.5类加载机制

tomcat8.5嵌入式启动

tomcat8.5启动过程远程调试

tomcat8.5 jsp编译过程

XML解析之Digester