Coder 爱翻译 How Tomcat Works 第五章 第二部分
The Pipeline Interface
我们提到的Pipeline接口的第一个方法invoke方法,这个方法是容器用来调用在pipeline中的valve和basic valve的。Pipeline接口允许你使用它的addValve方法来添加一个新的valve和使用removeValve方法来移除一个valve。最后,你使用它的setBasic方法给pipeline来指定一个basic valve和它的getBasic方法获取basic valve。basic valve是在最后被调用的,它负责处理request和相应的response。下面是Pipeline接口:
再一次,注意invoke方法。第一件事是invoke方法调用valve context 的invokeNext方法调用pipeline的下一个valve。然后打印头部信息值。
ex05.pyrmont.startup.Bootstrap1
Bootstrap1类用来启动这个应用程序。// make the application wait until we press Enter. System.in.read();
Running the Application