1. server的实例类为:org.apache.catalina.core.StandardServer为顶层容器。

2.二级容器GlobalNamingResources,设置认证用户信息。

<GlobalNamingResources>

<!-- Editable user database that can also be used by

UserDatabaseRealm to authenticate users

-->

<Resource name="UserDatabase" auth="Container"

type="org.apache.catalina.UserDatabase"

description="User database that can be updated and saved"

factory="org.apache.catalina.users.MemoryUserDatabaseFactory"

pathname="conf/tomcat-users.xml" />

</GlobalNamingResources>

3. 二级容器service,包括了多个connector和一个engine

<!-- A "Service" is a collection of one or more "Connectors" that share

a single "Container" Note:  A "Service" is not itself a "Container",

so you may not define subcomponents such as "Valves" at this level.

Documentation at /docs/config/service.html

-->

<Service name="Catalina">
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

3. 三级容器Engine包括Realm和Host。

<Engine name="Catalina" defaultHost="localhost">

<!--For clustering, please take a look at documentation at:

/docs/cluster-howto.html  (simple how to)

/docs/config/cluster.html (reference documentation) -->

<!--

<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

-->

<!-- Use the LockOutRealm to prevent attempts to guess user passwords

via a brute-force attack -->

<Realm className="org.apache.catalina.realm.LockOutRealm">

<!-- This Realm uses the UserDatabase configured in the global JNDI

resources under the key "UserDatabase".  Any edits

that are performed against this UserDatabase are immediately

available for use by the Realm.  -->

<Realm className="org.apache.catalina.realm.UserDatabaseRealm"

resourceName="UserDatabase"/>

</Realm>

<Host name="localhost"  appBase="webapps"

unpackWARs="true" autoDeploy="true">

<!-- SingleSignOn valve, share authentication between web applications

Documentation at: /docs/config/valve.html -->

<!--

<Valve className="org.apache.catalina.authenticator.SingleSignOn" />

-->

<!-- Access log processes all example.

Documentation at: /docs/config/valve.html

Note: The pattern used is equivalent to using pattern="common" -->

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

prefix="localhost_access_log." suffix=".txt"

pattern="%h %l %u %t &quot;%r&quot; %s %b" />

</Host>

</Engine>

实现类关系

Event-Listerner事件监听模式

事件监听同步模式分两个部分:Event Source和Event Listener:
Event Source:被监听者的事件集合,可能是方法,提供事件的注册加入和移除功能。类似被观察者的集合。
Event Listener:事件的监听者,当事件被触发,所有监听这个事件的监听者将被通知,然后执行自己的Action响应动作。

事件监听异步模式在Source和Listener之间引入event queue,
event queue是一个基于事件的publish-subscribe. 它一种松耦合方式提供不同模块和角色之间异步通讯。它比同步更加松耦合,这样,我们就把Source-Listener改成了publish-queue-subscribe方式。

转载于:https://www.cnblogs.com/davidwang456/p/3251018.html

tomcat server容器解读相关推荐

  1. apache http server 停止工作_Springboot以Tomcat为容器实现http重定向到https的两种方式

    1 简介 本文将介绍在Springboot中如何通过代码实现Http到Https的重定向,本文仅讲解Tomcat作为容器的情况,其它容器将在以后一一道来. 建议阅读之前的相关文章: (1) Sprin ...

  2. tomcat源码解读(一)

    tomcat源码解读(一) 什么是 tomcat ? Tomcat是由Apache软件基金会下属的Jakarta项目开发的一个Servlet容器,按照Sun Microsystems提供的技术 规范, ...

  3. tomcat server.xml中文版

    为什么80%的码农都做不了架构师?>>>    Tomcat Server的结构图 该文件描述了如何启动Tomcat Server <Server>     <Li ...

  4. Tomcat源码解读系列(二)——Tomcat的核心组成和启动过程

    声明:源码版本为Tomcat 6.0.35 前面的文章中介绍了Tomcat的基本配置,每个配置项也基本上对应了Tomcat的组件结构,如果要用一张图来形象展现一下Tomcat组成的话,整个Tomcat ...

  5. Tomcat server.xml配置示例

    转载自    Tomcat server.xml配置示例 几乎所有容器类型的应用都会包含一个名为 server.xml 的文件结构.基本上,其中的每个元数据或者配置都是容器完成初始化所需要的.正是由于 ...

  6. Spring Boot Server容器配置

    转载自 Spring Boot Server容器配置 参数配置容器 server.xx开头的是所有servlet容器通用的配置,server.tomcat.xx开头的是tomcat特有的参数,其它类似 ...

  7. Tomcat Server的结构图

    该文件描述了如何启动Tomcat Server <Server>     <Listener />     <GlobaNamingResources>     & ...

  8. Virgo Tomcat Server是什么?

    Virgo Tomcat Server是什么? Virgo Tomcat Server, 简称VTS, 是Virgo Server应用服务器的一种. 它是轻量级, 模块化, 基于OSGi系统.提供从开 ...

  9. tomcat server.xml文件的配置解析

    一直想写个tomcat server.xml文件的配置详细解析,忽然发现网上有人写的挺不错的,这里就转载 :https://www.cnblogs.com/kismetv/p/7228274.html

最新文章

  1. ExtJS ComboBox 异步读取项后默认选中某项
  2. JZOJ__Day 9:【普及模拟】算法学习(sfxx)
  3. 一文看懂WebTransport
  4. BBV:实验基本块向量生成工具
  5. jupyter notebook的单独安装与使用
  6. 设计模式的征途—7.适配器(Adapter)模式
  7. 思科ccna教材_什么是CCNA或Cisco认证网络助理?
  8. SQLserver2019找不到配置管理工具解决办法
  9. STM32F10xx时钟系统框图及说明学习笔记
  10. #7220. 「微课 3.6.2 例 1」亚瑟王
  11. 计算机网络英语形容词,英语常用形容词有哪些
  12. 二层交换机VLAN基础配置
  13. 快速在PPT里插入多张图片
  14. 古代地图的那些趣事儿
  15. 计算机打印机安装步骤,打印机安装步骤
  16. MOGRT替换视频,图像,照片及LOGO?如何替换PR动态图形模板中的图片视频素材
  17. PHP服务器获取客户端IP地址
  18. CDLinux U盘制作教程
  19. HP收购3Com在2009年全球最佳品牌100强中,惠普排名11位,思科14位
  20. Python里的%s和%d是什么意思

热门文章

  1. mfc 怎么让键盘上下左右控制图片移动_[源码和文档分享]基于MFC的陨石撞飞机游戏设计与实现...
  2. 计算机应用基础操作题教学考试,电大教学全国计算机应用基础考试网考内容全部操作题.doc...
  3. linux赋予文件夹所有权限_linux – 如何将某些用户权限仅授予子文件夹
  4. 设计非常优秀的软件界面
  5. mysql锁简谈_mysql锁简谈
  6. delete语句与reference约束冲突怎么解决_mysql update语句和原数据一样会更新么
  7. python常用操作符_Python--3常用操作符
  8. java怎么写算法_关于读写锁算法的Java实现及思考
  9. vbnullchar相当于 java_VB第2版习题与解答的.doc
  10. java 学习(一)冒泡排序