On Tue, 21 Aug 2001, Jens-A. Reinhardt wrote:

> Looking at the code I would assume that I have to write a
> MyProtocolConnectionHandler and corresponding Request/ResponseAdapter that
> extend/implement the TCPConnectionHandler, ResponseImpl, and RequestImpl.
>
> Since I haven't found any documentation about how to implement another
> protocol I would like to know if thats all. I mean, to write such classes
> and tell Tomcat in server.xml to use them.

> I assume that there must be some documentation out on how Tomcat works
> internally, however, I wasn't able to find it. So if I missed something
> please tell me where to look.

Well, there isn't too much - an old 'internal.html', and the source.

What you want to do is not very difficult - you need to write a class
extending BaseInterceptor, with setters for all properties you need. That
object can be declared in modules.xml and used in server.xml the same as
an ant task.

You'll be notified of all engine states ( including the "run" state, when
you should start listening for requests ).

The big problem is how do you want to interact with the rest of the system
- authenticators, etc. What I would do is use the existing Requests, etc
and use the protocol as if it was a http session.

That would work for most protocols I know - for example a SMTP session can
be viewed as a number of HTTP requests in a session. Then you can use
servlets/jsps as in a web applications. Your module will act as a proxy
between the protocol and http.

Another solution is to ignore tomcat Request/Response/modules and just use
what you need ( for example the configuration, or hooks, or sandbox ).

Costin




Reply via email to