1.
tomcat有4中级别的容器。都实现容器接口。
The first thing to note about containers in Catalina is that there are four types of
containers at different conceptual levels:
Engine. Represents the entire Catalina servlet engine.
Host. Represents a virtual host with a number of contexts.
Context. Represents a web application. A context contains one or more
wrappers.
Wrapper. Represents an individual servlet.
2.
一个context里一般有一个或者多个wrapper,每个wrapper都对应了一个servlet.
wrapper的parent必须是context。参照下边的StandardWrapper 类声明。
[color=red]StandardWrapper [/color]is the standard implementation of the <b>Wrapper</b> interface that [color=red]represents an individual servlet definition. No child Containers are allowed, and the parent Container must be a Context.[/color]
3.
Tomcat 对观察者做了扩展,增加了另外两个类:LifecycleSupport、LifecycleEvent,它们作为辅助类扩展了观察者的功能。LifecycleEvent 使得可以定义事件类别,不同的事件可区别处理,更加灵活。LifecycleSupport 类代理了主题对多观察者的管理,将这个管理抽出来统一实现,以后如果修改只要修改 LifecycleSupport 类就可以了,不需要去修改所有具体主题,因为所有具体主题的对观察者的操作都被代理给 LifecycleSupport 类了。这可以认为是观察者模式的改进版
tomcat有4中级别的容器。都实现容器接口。
The first thing to note about containers in Catalina is that there are four types of
containers at different conceptual levels:
Engine. Represents the entire Catalina servlet engine.
Host. Represents a virtual host with a number of contexts.
Context. Represents a web application. A context contains one or more
wrappers.
Wrapper. Represents an individual servlet.
2.
一个context里一般有一个或者多个wrapper,每个wrapper都对应了一个servlet.
wrapper的parent必须是context。参照下边的StandardWrapper 类声明。
[color=red]StandardWrapper [/color]is the standard implementation of the <b>Wrapper</b> interface that [color=red]represents an individual servlet definition. No child Containers are allowed, and the parent Container must be a Context.[/color]
3.
Tomcat 对观察者做了扩展,增加了另外两个类:LifecycleSupport、LifecycleEvent,它们作为辅助类扩展了观察者的功能。LifecycleEvent 使得可以定义事件类别,不同的事件可区别处理,更加灵活。LifecycleSupport 类代理了主题对多观察者的管理,将这个管理抽出来统一实现,以后如果修改只要修改 LifecycleSupport 类就可以了,不需要去修改所有具体主题,因为所有具体主题的对观察者的操作都被代理给 LifecycleSupport 类了。这可以认为是观察者模式的改进版