Jetty源码分析-Server

在熟悉server部分源码之前,我们先看看Server主要干什么?
Jetty 官网对它的简单描述:"the plumbing between a collection of Connectors that accept HTTP connections and a collection of Handlers that service requests from the connections and produce responses, with threads from a thread pool doing the work",简单明了,server就是一个管道,管道的一头是负责 接受各种http连接请求的Connector组件,另外一头就是一堆的Handler,这些handler就负责处理来自Connetor的各种request请求,它维护了一个线程池来完成 真正的请求任务处理并将结果返回client。所以说白了,Server组件主要工作就是负责打通Connector和Handler.


Jetty源码分析-Server_第1张图片

1. Jetty Server配置

废话不多说,直接上一段





    
        
            Redirecting stderr/stdout to 
        
    

    
        20
        200
        jetty-worker
    

    
        
            
                
                    
                    8080
                    
                
            
        
    

    
        org.eclipse.jetty.webapp.WebInfConfiguration
        org.eclipse.jetty.webapp.WebXmlConfiguration
        org.eclipse.jetty.webapp.MetaInfConfiguration
        org.eclipse.jetty.webapp.FragmentConfiguration
        org.eclipse.jetty.plus.webapp.EnvConfiguration
        org.eclipse.jetty.plus.webapp.PlusConfiguration
        org.eclipse.jetty.annotations.AnnotationConfiguration
        org.eclipse.jetty.webapp.JettyWebXmlConfiguration
    

    
        
            
                
                    
                        
                            src/main/webapp
                            /
                            true
                            src/main/webapp/WEB-INF/web.xml
                            
                        
                    
                
            
        
    

    true
    1000
    
    false
    false

你可能感兴趣的:(Jetty源码分析-Server)