tomcat 核心架构 组件

文章目录

  • 概念
  • tomcat 核心架构图


概念

  • 切换io类型;根据协议类型(http; ajp/1.3;)确定; 也就是在 server.xml
  • 每个标签对应一个服务;StandardContext 类
  • Wrapper 可以等价于Setvlet
  • Constants 里边定义一些配置文件
  • 一个 web.xml 对应一个WebXml 对象;
  • ContextConfig 加载每个Servlet 的配置;

tomcat 核心架构图

			---------------------------------------------------------------------------------------------------------
			| server-1																								|
			| 		[Listener](多个)   {Global Naming Resources[Resource](多个)} [jndi]                              |
			|                                                                                                       |
			| ----------------------------------------------------------------------------------------------------  |
			| | service-N																						 |  |
			| | -----------------\		------------------------------------------------------------------------ |  |
			| | | connector-N    |      | Engine-1 															   | |  |
			| | |[thread-pool]   |      |		[Listener]-N  [realm]                                          | |  |
-----http-->|-|-|-->             |      |                                                                      | |  |
-----ajp--->|-|-|-->             |      |                                                                      | |  |
-----https->|-|-|-->             |      |                                                                      | |  |
			| | |                |      |	------------------------------------------------------------------ | |  |
			| | |                |      |   |	Host-N : [Listener]-N  [realm]							     | | |  |
			| | |                |      |   |	                                                             | | |  |
			| | |                |      |   |      ------------------------------------------------------    | | |  |
			| | |                |      |   |      |  Context-N: [manager] [loader] [Resource-Link]		|    | | |  |
			| | ------------------      |   |      |		   [Resouce] [Listener] [realm]             |    | | |  |
			| |         |               |   |      |  -----------------------------------------------   |    | | |  |
			| |         |               |   |      |  | WebApp: [Filter]-N [Wrapper]-N [POJO]-N	|   |    | | |  |
			| |         |               |   |      |  |                         |                   |   |    | | |  |
			| |         |               |   |      |  |                     [servlet]               |   |    | | |  |
			| |         |               |   |      |  -----------------------------------------------   |    | | |  |
			| |         |               |   |      \----------------------------------------------------/    | | |  |
			| |         |               |   ----------------------------------------------------------------/  | |  |
			| |         |               -----------------------------------------------------------------------/ |  |
			| |     [executor]                                                                                   |  |
			| ----------------------------------------------------------------------------------------------------  |
			---------------------------------------------------------------------------------------------------------
- connector	-> servlet	

你可能感兴趣的:(java,tomcat,架构,servlet)