Tomcat源代码阅读笔记[1]

准备开始阅读Tomcat 5.5的源代码,可能会把笔记和进度贴在这里。

org.apache.catalina
Interface Authenticator

一个被用作标记的interface,和serilized interface类似,自身没有定义任何函数。被用来标记提供认证服务的类。

<o:p> </o:p>

org.apache.catalina
Interface Cluster

TO DO

<o:p> </o:p>

org.apache.catalina
Interface Contained

用作表明某个类至多被一个Container包含。

<o:p> </o:p>

org.apache.catalina
Interface Container

该接口的作用是从客户端接受request并生成response。为了能够在运行时定义一个Container的处理行为,一般来说实现Container的类还会同时实现Pipeline这个接口,通过在运行时动态改变Pipeline中包含的Value对象的排列来改变对request的处理方法。

Container出现在Catalina中的多个概念层次,分别对应为

            Engine  - To DO Representation of the entire Catalina servlet engine, most likely containing one or more subcontainers that are either Host or Context implementations, or other custom groups.

            Host     - TO DO Representation of a virtual host containing a number of Contexts

            Context            - TO DO Representation of a single ServletContext, which will typically contain one or more Wrappers for the supported servlets.

            Wrapper          - TO DO Representation of an individual servlet definition (which may support multiple servlet instances if the servlet itself implements SingleThreadModel).

四个子interface

一个Container可以包含子Container。该interface定义了一些和操作其包含的子Container相关的事件,如加入和删除子Container

<o:p> </o:p>

org.apache.catalina
Interface ContainerListener

定义了一个接受ContainerEvent类型参数的containerEvent函数。

<o:p> </o:p>

org.apache.catalina
Interface ContainerServlet

TO DO

<o:p> </o:p>

org.apache.catalina
Interface Context

用来代表Servlet ContextContainer。其父Container一般为Host(代表一个虚拟主机),其子Container一般为Wrapper(代表一个具体的Servlet实现)。

interface有很多和Servlet Context相关的函数。例如addParameteraddErrorPageaddServletMapping等等,不难看出这些函数和每个web applicationweb.xml中的元素相关。

<o:p> </o:p>

org.apache.catalina
Interface Engine

TO DO

<o:p> </o:p>

org.apache.catalina
Interface Group

用来代表一个user组。

<o:p> </o:p>

org.apache.catalina
Interface Host

TO DO 用来代表一个虚拟主机。其父Container一般为Engine,其子Container一般为Context

<o:p> </o:p>

org.apache.catalina
Interface InstanceListener

TO DO

<o:p> </o:p>

org.apache.catalina
Interface Lifecycle

当某个组件需要支持生命期时,就实现这个interface。该接口定义了一系列的生命期事件,并提供startstop该组件和为该组件添加、删除listener的方法。

<o:p> </o:p>

org.apache.catalina
Interface LifecycleListener

定义了一个接受LifecycleEvent类型参数的lifecycleEvent函数。

<o:p> </o:p>

org.apache.catalina
Interface Loader

该接口代表了Container用来载入classJava ClassLoader对象。个人认为该接口的实现类应为Java ClassLoader的一个wrapper

TO DO 实现该接口的一些要求(与Context的生命期有关)。

<o:p> </o:p>

org.apache.catalina
Interface Manager

用来管理某个特定ContainerSession池。

TO DO 实现该接口的一些要求(与Context的生命期有关)。

<o:p> </o:p>

org.apache.catalina
Interface Pipeline

一个Pipeline就是由一些Value组成的序列。当request到达时,Pipeline将其按顺序通过每一个ValuePipeline的最后一个Value被称为BasicBasic将完成response的生成,而不是将request继续传递下去。

<o:p> </o:p>

org.apache.catalina
Interface Realm

TO DO

你可能感兴趣的:(apache,tomcat,Web,servlet)