On Tue, 18 Dec 2001, Mika Goeckel wrote:

> Date: Tue, 18 Dec 2001 21:12:34 +0100
> From: Mika Goeckel <[EMAIL PROTECTED]>
> Reply-To: Tomcat Developers List <[EMAIL PROTECTED]>
> To: Tom Drake <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Cc: Craig McClanahan <[EMAIL PROTECTED]>
> Subject: Re: load balancing - integration thoughts
>
> Hi Tom, hi Craig!
>
> Another approach would be to extend the event model that is used for Session
> (Servlet Spec SRV.10.1/SRV15.1.13) to fire events when a request is
> completed..
> Craig, would it be compliant with the spec to add another subclass of
> SessionEvent (Maybe SessionRequestEvent)?
>

We can't add javax.servlet.* events (that's all managed by the Servlet
Spec), but we could certainly create "request started" and "request ended"
events that are Catalina-specific that you could register listeners for.

Another approach would be to stick a Valve in the request processing
pipeline.  Since all requests would go through it, you've got a natural
opportunity to preprocess and postprocess as needed.

> Then you could register your manager with newly created sessions as a
> SessionListener.
>
> Mika
>
Craig


> ----- Original Message -----
> From: "Tom Drake" <[EMAIL PROTECTED]>
> To: "Mika Goeckel" <[EMAIL PROTECTED]>
> Cc: "Craig McClanahan" <[EMAIL PROTECTED]>
> Sent: Tuesday, December 18, 2001 8:50 PM
> Subject: load balancing - integration thoughts
>
>
> > Mika and/or Craig:
> >
> > After having looked around the code, here's my thoughts
> > about how to implement 'end-of-request' notification. Because
> > we need post session updates to the 'other' repositories,
> > and 'unlock' the session at the end of each Http request.
> >
> > Can you review and comment? Being new to Tomcat, I'd
> > like some confirmation that I'm on the right track, or some
> > gentle guidance.
> >
> > o.a.c.Manager.java
> > - add new method
> >     public void completeRequest(String sessionId);
> >
> > o.a.c.session.ManagerBase.java
> > - add new method
> >     public void completeRequest(String sessionId) {
> >         // noop - non-distributed sessions don't care.
> >     }
> >
> > o.a.c.Request.java
> > - add new method
> >     public void completeRequest();
> >
> > o.a.c.connector.ResponseBase.java
> > - modify 'finishResponse()' by adding the following code
> >    getRequest().completeRequest();
> >
> > o.a.c.connector.RequestBase.java
> > - add new method
> >     public void completeRequest() {
> >         if (session != null) {
> >             manager.completeRequest(session.getId());
> >         }
> >     }
> >
> > o.a.c.session.RepositoryManager - new class that extends
> > StandardManager.java.
> >
> >     public void completeRequest(String sessionId) {
> >         // deal with updating the remote repositories here....
> >     }
> >
> > There's lots of other code in RepositoryManager, I just wanted to focus
> > on the end-of-request notification bits.
> >
> >
> > Regards,
> >
> > Tom Drake
> > President, software/etc inc.
> > Email: [EMAIL PROTECTED]
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to