Peter Donald wrote:
> [snip]
> I am not saying that Catalinas concept of a valve is completely correct (it
> uses the Anti-Pattern Subvertion of Control - yuck !!) but it is definetly
> a step in the right direction. Personally if I was doing it then I would
> implement Inversion of Control and your valve interface would be as simple
> as below but I think Valves as they exist are a step forward thou YMMV.
>
> public interface Valve {
> public void invoke(ValveContext context, Request request, Response response)
> throws IOException, ServletException;
> }
>
> public class MyValve implements Valve {
> public void invoke(ValveContext context, Request request, Response response)
> throws IOException, ServletException
> {
> ...do stuff with request...
> context.invokeNext( request, response );
> ...dostuff with response...
> }
> }
>
If you change the names and parameter orders a little, you have just quoted the
new api for javax.servlet.Filter in the 2.3 Proposed Final Draft.
I'd be game to change the Valve APIs to conform to this kind of pattern in a 4.1
timeframe, if people prefer it. If we're ever going to do this, earlier is better
(before too many valves that have to be changed get created).
>
> Cheers,
>
> Pete
>
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]