Thom Park wrote:
> Hello,
>
> I'm intrigued by a comment in the tomcat 4 server.xml file:
>
> "Normally, that Container is an "Engine", but this is not required."
>
> What does this mean then? Is it possible to construct a container that
> isn't called a container, if so how and what
> would this really mean?
>
> What is meant by a container hierarchy?
The names come from the interfaces (in org.apache.catalina) that are
implemented by the various components. Every "container" in Tomcat 4.0 is
an implementation of the org.apache.catalina.Container interface. The
primary job of a container is to process requests via the invoke() method.
Tomcat includes four subinterfaces that extend Container:
* org.apache.catalina.Engine - Represents a "servlet engine" that
processes all requests for a particular Tomcat JVM.
* org.apache.catalina.Host - Represents a single virtual host.
Can have multiple Hosts associated with an Engine.
* org.apache.catalina.Context - Represents a single web
application (one-to-one relationship with a ServletContext).
Can have multiple Contexts associated with a Host.
* org.apache.catalina.Wrapper - Represents a single servlet
(or JSP page). Can have multiple Wrappers associated with
a Context.
>
> How is this implemented in tomcat i.e. can you define an Engine X and
> then nest another level of engines under X ?
> After all, that's what a hierarchy means to me.
>
The hierarchy of containers is really:
Engine <= Host <= Context <= Wrapper
where "<=" indicates a one-to-many relationship.
The particular documentation comment you quoted above is from the
Connector interface (that is, the component that represents a TCP/IP
server socket) - the job of the Connector is to:
* Receive a request
* Translate it into an org.apache.catalina.Request object
* Synthesize an org.apache.catalina.Response object
* Pass this Request and Response to the Container (which
is normally an Engine but need not be)
* Translate the completed Response back into an
HTTP response sent back to the client.
>
> I know I'm getting confused by the big jump from the 'shape' of the
> server.xml file in 3.2 compared to that supplied in 4.0.
>
> As I'm trying to write something to manage the configuration of tomcat
> 4, I need to know more about the 'shape' of the beast.
>
There are some useful UML diagrams in the Tomcat 4.0 developer
documentation, available at:
http://jakarta.apache.org/tomcat/jakarta-tomcat-4.0/catalina/docs/index.html
>
> Any help/explanation/pointers would be a great!
>
> thanks,
>
> -Thom
>
Craig McClanahan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]