随笔分类 -  tomcat

摘要:管道方法 org.apache.catalina.core.StandardWrapperValve#invoke() 执行的时候, 创建了一个过滤器链, 并且进行了调用: //过滤器链 ApplicationFilterChain filterChain = ApplicationFilterFa 阅读全文
posted @ 2020-08-23 11:26 Sniper_ZL 阅读(288) 评论(0) 推荐(0)
摘要:上一篇终于找到了调用管道方法的地方, 代码片段: //org/apache/catalina/connector/CoyoteAdapter#service // Parse and set Catalina and configuration specific // request paramet 阅读全文
posted @ 2020-08-23 11:24 Sniper_ZL 阅读(369) 评论(0) 推荐(0)
摘要:tomcat启动的时候, 起了异步起了两个类: Poller 和 Acceptor. 默认情况下, 是由 NioEndpoint 的 Acceptor 来监听接收请求的. Acceptor.run() 代码片段: //org.apache.tomcat.util.net.NioEndpoint.Ac 阅读全文
posted @ 2020-08-23 11:22 Sniper_ZL 阅读(1161) 评论(0) 推荐(0)
摘要:通过前面执行的流程, 大致可以画出一些时序图来, 通过时序图, 可以更加清晰的观看整个流程走向. Bootstrap.start(): Engine 和 Connector 内容比较多, 只能分出来画了 Engine.start() Connector.start() 阅读全文
posted @ 2020-08-23 11:21 Sniper_ZL 阅读(172) 评论(0) 推荐(0)
摘要:StandardService#startInternal中, 除了调用了 engine.start()外, 还调用了 connector#start() Connector#start() connector.start()最终调用的是 Connector#startInternal()方法. p 阅读全文
posted @ 2020-08-23 11:20 Sniper_ZL 阅读(263) 评论(0) 推荐(1)
摘要:接着上一篇, 该到StandardContext的 init 和 startInternal 方法了. StandardContext#initInternal() 此方法由 org.apache.catalina.util.LifecycleBase#init() 调用而来. //org.apac 阅读全文
posted @ 2020-08-23 11:19 Sniper_ZL 阅读(283) 评论(0) 推荐(0)
摘要:Bootstrap#start() daemon = bootstrap, 所以调用的还是 org.apache.catalina.startup.Bootstrap#start() public void start() throws Exception { if (catalinaDaemon 阅读全文
posted @ 2020-08-23 11:18 Sniper_ZL 阅读(280) 评论(0) 推荐(0)
摘要:Bootstrap#load() daemon.load(args) 调用的, 其实就是 bootstrap.load(args) main方法中执行了 daemon = bootstrap; org.apache.catalina.startup.Bootstrap#load(): private 阅读全文
posted @ 2020-08-23 11:17 Sniper_ZL 阅读(284) 评论(0) 推荐(0)
摘要:代码片段: org.apache.catalina.startup.Bootstrap#main() if (daemon == null) { // Don't set daemon until init() has completed Bootstrap bootstrap = new Boot 阅读全文
posted @ 2020-08-23 11:16 Sniper_ZL 阅读(265) 评论(0) 推荐(0)
摘要:tomcat架构 从这张图上, 可以很明确的看出, 各个组件的关系 Server: 服务器, 也就是一个tomcat Service: 服务, 将多个 Connector 和 一个 Engine 组合起来, 成为一个服务. 1#Server -- n#Service Connector: 接收器, 阅读全文
posted @ 2020-08-23 11:13 Sniper_ZL 阅读(374) 评论(0) 推荐(0)