On Fri, 17 Aug 2001, Kevin Seguin wrote:
> >
> > > also, would it be possible to use a Valve to accomplish this?
> >
> > Yes...
> >
> > > how are valves processed? are they stacked such that the
> > first valve entered
> > > is the last one exited?
> >
> > Correct.
> >
> > > or are they chained such that one valve is processed after
> > the next, and once
> > > the last valve is processed, the response is sent?
> >
> > Nope... See how the "invoke()" method works...
> >
> > > what i'm getting at is, could you put a valve in place such
> > that it could
> > > always log (or send events) at the beginning of a request
> > and right before the
> > > response is sent?
> >
> > In TC4.0 valve are more-or-less like loggers. So if you put
> > down a valve at
> > the bottom of your <Engine> (the first root component in the
> > component stack
> > of Catralina), you'll end up intercepting all requests coming from the
> > connectors... :)
> >
>
> a valve can choose to not invoke the next valve by not calling
> context.invokeNext(), right?
Yes. That's how authentication works, for example.
> so, this would be guaranteed to work only if
> the "statistic" valve was the first valve, right?
>
Yes, in the sense that it would capture *all* of the processing
time. Your Valve would still work correctly even if it wasn't first, but
it would not be tracking the time spent in any valves invoked before it
:-).
> thanks for the info :)
>
Craig