You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Mika Goeckel <mi...@gmx.de> on 2001/12/18 21:12:34 UTC

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)?

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

Mika

----- Original Message -----
From: "Tom Drake" <rt...@pobox.com>
To: "Mika Goeckel" <mi...@gmx.de>
Cc: "Craig McClanahan" <cr...@apache.org>
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: debugger@engineer.com
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: load balancing - integration thoughts

Posted by Tom Drake <rt...@pobox.com>.
Mika:


That would certainly work. However, would this mean that
all SessionListeners would start picking up this new event?

Tom

----- Original Message -----
From: "Mika Goeckel" <mi...@gmx.de>
To: "Tom Drake" <rt...@pobox.com>; <to...@jakarta.apache.org>
Cc: "Craig McClanahan" <cr...@apache.org>
Sent: Tuesday, December 18, 2001 12:12 PM
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)?
|
| Then you could register your manager with newly created sessions as a
| SessionListener.
|
| Mika
|
| ----- Original Message -----
| From: "Tom Drake" <rt...@pobox.com>
| To: "Mika Goeckel" <mi...@gmx.de>
| Cc: "Craig McClanahan" <cr...@apache.org>
| 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: debugger@engineer.com
| >
|
|
| --
| To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
| For additional commands, e-mail:
<ma...@jakarta.apache.org>
|
|
|


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: load balancing - integration thoughts

Posted by Tom Drake <rt...@pobox.com>.
Craig:

I'll look into both of these suggestions. The Valve idea sounds
like a winner, since it wouldn't require changing anything in
the 'other' packages.

Thanks.

Tom

----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Cc: "Tom Drake" <rt...@pobox.com>
Sent: Tuesday, December 18, 2001 1:33 PM
Subject: Re: load balancing - integration thoughts


|
|
| On Tue, 18 Dec 2001, Mika Goeckel wrote:
|
| > Date: Tue, 18 Dec 2001 21:12:34 +0100
| > From: Mika Goeckel <mi...@gmx.de>
| > Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
| > To: Tom Drake <rt...@pobox.com>, tomcat-dev@jakarta.apache.org
| > Cc: Craig McClanahan <cr...@apache.org>
| > 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" <rt...@pobox.com>
| > To: "Mika Goeckel" <mi...@gmx.de>
| > Cc: "Craig McClanahan" <cr...@apache.org>
| > 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: debugger@engineer.com
| > >
| >
| >
| > --
| > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
| > For additional commands, e-mail:
<ma...@jakarta.apache.org>
| >
| >
|
|
|


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: load balancing - integration thoughts

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 18 Dec 2001, Mika Goeckel wrote:

> Date: Tue, 18 Dec 2001 21:12:34 +0100
> From: Mika Goeckel <mi...@gmx.de>
> Reply-To: Tomcat Developers List <to...@jakarta.apache.org>
> To: Tom Drake <rt...@pobox.com>, tomcat-dev@jakarta.apache.org
> Cc: Craig McClanahan <cr...@apache.org>
> 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" <rt...@pobox.com>
> To: "Mika Goeckel" <mi...@gmx.de>
> Cc: "Craig McClanahan" <cr...@apache.org>
> 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: debugger@engineer.com
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>