Budi Kurniawan, a popular author or articles that have appeared on java.net, ONJava.com, and elsewhere, has self-published his book, How Tomcat Works. He has given us permission to provide you with two chapters.
Chapter 5, "Containers," "discusses the container module. A container is represented by the
org.apache.catalilna.Container interface, and there are four types of containers: engine, host, context, and wrapper. This chapter offers two applications that work with contexts and wrappers."
Chapter 6, "Lifecycles," "explains the
Lifecycleinterface. This interface defines the lifecycle of a Catalina component and provides an elegant way of notifying other components of events that occur in that component. In addition, the
Lifecycle interface provides an elegant mechanism for starting and stopping all of the components in Catalina with one single start/stop."