tomcat源码分析总结

1. tomcat类加载机制,为什么要违背双亲委托机制(线程上下文类加载器)
    线程上下文类加载器是指调用方法当前类队员的类加载器。parant类加载器去请求子加载器加载某些依赖的jar

2. tomcat线程模型

3. tomcat之connector分析

4. tomcat之valve机制

5. tomcat之容器类分析
    Engine:org.apache.catalina.core.StandardEngine
    Host: org.apache.catalina.core.StandardHost
    Context:org.apache.catalina.core.StandardContext
    Wrapper:org.apache.catalina.core.StandardWrapper
    
6. tomcat处理一个http请求的过程

7. tomcat对url的编解码过程

8. tomcat8对cookie的处理

9. tomcat初始化与启动

10. tomcat是怎么实现的热部署
    1)Classloader重写,通过自定义classloader加载相应的jsp编译后的class到JVM中。
    2)通过动态修改内存中的字节码,将修改过的class再次装载到JVM中。


    web容器和servlet容器的区别是什么;
    
    在springMVC中的web.xml是什么时候加载到tomcat中的;
    
    tomcat是怎么加载我们的web服务的;
        
    一个http请求是怎么被tomcat监听到的,会有哪些处理;
    
    为什么请求可以有需要通过nginx的,也可以不需要nginx的直接请求到tomcat上?
    
    
11. CopyOnWriteArrayList原理

12. 并发锁ReentrantReadWriteLock

13. 正则
    private static final Pattern PATH_PATTERN = Pattern.compile("(\".*?\")|(([^,])*)");
    
14 tomcat默认启动参数
    connector默认值: 10000
      public LimitLatch(long limit) {
        this.limit = limit;
        this.count = new AtomicLong(0);
        this.sync = new Sync();
    }
    
        private SynchronizedStack<PollerEvent> eventCache;
        默认128
        
    工作线程数 最小空闲10个,最大200个
      public void createExecutor() {
        internalExecutor = true;
        TaskQueue taskqueue = new TaskQueue();
        TaskThreadFactory tf = new TaskThreadFactory(getName() + "-exec-", daemon, getThreadPriority());
        executor = new ThreadPoolExecutor(getMinSpareThreads(), getMaxThreads(), 60, TimeUnit.SECONDS,taskqueue, tf);
        taskqueue.setParent( (ThreadPoolExecutor) executor);
    }
    TaskQueue
     @Override
    public boolean offer(Runnable o) {
      //we can't do any checks
        if (parent==null) return super.offer(o);
        //we are maxed out on threads, simply queue the object
        if (parent.getPoolSize() == parent.getMaximumPoolSize()) return super.offer(o);
        //we have idle threads, just add it to the queue
        if (parent.getSubmittedCount()<=(parent.getPoolSize())) return super.offer(o);
        //if we have less threads than maximum force creation of a new thread
        if (parent.getPoolSize()<parent.getMaximumPoolSize()) return false;
        //if we reached here, we need to add it to the queue
        return super.offer(o);
    }
    
    Poller线程
     poller = new Poller();
            Thread pollerThread = new Thread(poller, getName() + "-ClientPoller");
            pollerThread.setPriority(threadPriority);
            pollerThread.setDaemon(true);
            pollerThread.start();
            
15. AJP协议是什么?

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值