设为首页 收藏本站
查看: 583|回复: 0

[经验分享] Tomcat构架学习笔记

[复制链接]

尚未签到

发表于 2017-1-28 11:59:51 | 显示全部楼层 |阅读模式
DSC0000.jpg

DSC0001.jpg

DSC0002.jpg

   HowTomcatWorks 第五章
  The SimpleContext class represents a context. It uses the SimpleContextMapper as its mapper and SimpleContextValve as its basic valve. Two valves, ClientIPLoggerValve and HeaderLoggerValve, are added to the context. Two wrappers, each represented by SimpleWrapper, are added as child containers of the context. The wrappers use SimpleWrapperValve as their basic valve but do not have additional valves.
  
The Context application uses the same loader and the two valves. However, the loader and valves are associated with the context, not a wrapper. This way, the loader can be used by both wrappers. The context is assigned as the container for the connector. Therefore, the connector will call the invoke method of the context every time it receives an HTTP request. The rest is not hard to figure out if you recall our discussion above:
  
  
1. A container has a pipeline. The container's invoke method calls the pipeline's invoke method.
  
2. The pipeline's invoke method invokes all the valves added to its container and then calls its basic valve's invoke method.
  
3. In a wrapper, the basic valve is responsible to load the associated servlet class and respond to the request.
  
  
4. In a context with child containers, the basic valve uses a mapper to find a child container that is responsible for processing the request. If a child container is found, it calls the invoke method of the child container. It then goes back to Step 1.
  
Now let's see the order of processing in the implementation. The SimpleContext class's invoke method calls the pipeline's invoke method.
  public void invoke(Request request, Response response) throws IOException, ServletException {
   pipeline.invoke(request, response);
  }
  The pipeline is represented by the SimplePipeline class. Its invoke method is as follows.
   public void invoke(Request request, Response response) throws IOException, ServletException { // Invoke the first Valve in this pipeline for this request
   (new SimplePipelineValveContext()).invokeNext(request, response);
   }
     第六章
DSC0003.jpg

     第8章 类装载器
  Starting from J2SE 1.2, the JVM employs three class loaders: bootstrap class loader, extension class loader, and system class loader.
  Each of the three class loaders has a parent-child relationship with each other, in which the bootstrap class loader sits at the top of the hierarchy and the system class loader at the bottom.
  
The bootstrap class loader is used to bootstrap the JVM. It starts working whenever you call the java.exe program. As such, it must be implemented using the native code because it is used to load the classes required for the JVM to function. Also, it is responsible for loading all the core Java classes, such as those in java.lang and java.io packages. The bootstrap class loader searches the core libraries such as rt.jar, i18n.jar, etc. Which libraries are searched depends on the version of the JVM and the operating system.
  The extension class loader is responsible for loading classes in a standard extension directory. This is to make the programmer's life easier because they can just copy JAR files into this extension directory and the jar files will be searched automatically.
  The extension library differs from one vendor to another. Sun's JVM's standard extension directory is /jdk/jre/lib/ext.
  
The system class loader is the default class loader and searches the directories and JAR files specified in the CLASSPATH environment variable.
                                              第9章 Session Manager
  
DSC0004.jpg

  第10章 Security
  A realm is a component used for authenticating a user. It can tell you whether or not a pair of user name and password is valid.
  A principal is represented by the java.security.Principal interface. Its implementation in Catalina is the org.apache.catalina.realm.GenericPrincipal class
  第11章 StandardWrapper
DSC0005.jpg

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-334473-1-1.html 上篇帖子: 同时开启多个tomcat(转) 下篇帖子: tomcat下部署war
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表