java的valve_Tomcat源码解析系列(九)Pipeline与Valve

tomcat与java web开发技术培训教材

91元

包邮

(需用券)

去购买 >

a49efef3af2137e5e9a17fbef3f766cd.png

前言

上篇文章讲到了 Wrapper 的启动。在这篇文章中初次提到了 Pipeline 和 Valve。Pipeline的实现类是 StandardPipeline,StandardPipeline 继承自 LifecycleBase,而 Valve 的实现类则比较多,这些实现类都继承自基类 ValveBase,而 ValveBase 继承自 LifecycleMBeanBase。

1. Pipeline 与 Valve 的初始化

在 ContainerBase 中有一个 Pipeline 类型的对象,其声明为:

/**

* The Pipeline object with which this Container is associated.

*/

protected final Pipeline pipeline = new StandardPipeline(this);

public StandardPipeline(Container container) {

super();

setContainer(container);

}

/**

* The Container with which this Pipeline is associated.

*/

protected Container container = null;

@Override

public void setContainer(Container container) {

this.container = container;

}

可以看出,每一个 Container 对象都包含了一个 Pipeline 对象,包括 Engine、Host、Context、Wrapper。

public StandardEngine() {

super();

pipeline.setBasic(new StandardEngineValve());

/* Set the jmvRoute using the system property jvmRoute */

try {

setJvmRoute(System.getProperty("jvmRoute"));

} catch(Exception ex) {

log.warn(sm.getString("standa

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值