03 2018 档案
摘要:(一)jdk中future和netty中future的比较 jdk中future: jdk中future的特点:1.无论结果是成功还是失败还是取消,返回的都是isdone();2.而且我们在异步操作触发和结束的时候比较关心其他的一些操作,在jdk的future中无法进行补充。所以netty对futu
阅读全文
摘要:public static void main(String[] args) { ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); // 只能检测 synachrozied 同步代码块 的死锁 // long[] deadlockedThreadIds = mbean.findMon...
阅读全文
摘要:ServerBootstrap 为 netty 建立服务端的辅助类, 以 NIO为例,创建代码如下: 核心参数如下: 初始化流程主要为 绑定本地端口 -> 注册自身到 EventLoop , 并注册 accept 和 read 事件 -> EventLoop的主循环中会不断的select注册的cha
阅读全文
摘要:Netty 事件循环主逻辑在 NioEventLoop.run 中的 processSelectedKeys函数中 processSelectedKeys 函数 执行时会判断是否执行优化的版本,即判断 SelectedSelectionKeySet 是否为空。 是否开启优化取决于是否设置了环境变量
阅读全文
摘要:Configuration : 由 mybatis-config.xml解析产生的配置对象 MapperRegistry : mapper注册中心 InterceptorChain : 用户自定义拦截器的执行链,能够拦截 Executor、StatementHandler、ParameterHand
阅读全文
摘要:MapperProxyFactory->MapperProxy->MapperMethod->MapperStatement->StatementHandler->ResultSetHandler,ParameterHandler
阅读全文
摘要:SqlSession.getMapper -> configuration.getMapper -> mapperRegistry.getMapper -> mapperProxyFactory.newInstance 返回mapper的代理对象 mapperProxy, 接口的查询、更新等方法通过
阅读全文

浙公网安备 33010602011771号