2024年10月6日
摘要: 嵌套对象映射 <resultMap id="userResultMap" type="com.example.User"> <id property="id" column="user_id"/> <result property="name" column="user_name"/> <resul 阅读全文
posted @ 2024-10-06 01:35 towboat 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 正向代理:代理服务器代理客户端,客户端对目标服务器不可见 反向代理: 代理服务器代理目标服务器,客户端不知道访问的具体哪台服务器 阅读全文
posted @ 2024-10-06 00:40 towboat 阅读(1) 评论(0) 推荐(0) 编辑
  2024年10月5日
摘要: 常用于网络文件传输 正常的网络传输 4次 上下文切换与拷贝 如下图 零拷贝使用诸如 mmap+write 或 sendfile ,只有一次cpu拷贝+mmap/write 阅读全文
posted @ 2024-10-05 16:43 towboat 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 代码大概如下 do { old_value = atomic_load(&c->count); // 获取当前值 //1 } while (!atomic_compare_exchange_weak(&c->count, &old_value, old_value + 1)); 1处c->count 阅读全文
posted @ 2024-10-05 00:22 towboat 阅读(0) 评论(0) 推荐(0) 编辑
  2024年10月4日
摘要: 采用nio:同步非阻塞的io模型 bio: 处理多个客户端请求时,每个客户端连接需要一个独立的线程来处理 I/O 操作,会大量消耗资源 nio组成: buffer ,selector,channel nio采用selector,监听socket channel 上是否有读写操作的事件,然后才执行读写 阅读全文
posted @ 2024-10-04 14:32 towboat 阅读(0) 评论(0) 推荐(0) 编辑
  2024年10月2日
摘要: http请求报文,响应报文 301 Moved Permanently 和 404 Not Found 301,服务器会返回新的 URL,客户端应该用新的 URL 进行访问。 502 错误意味着代理服务器和上游服务器无法通信,比如上游服务器故障 504 Gateway Time-out 上游服务器响 阅读全文
posted @ 2024-10-02 14:29 towboat 阅读(1) 评论(0) 推荐(0) 编辑
  2024年10月1日
摘要: 单例 生命周期 在bean加载/销毁前后,如果想实现某些逻辑? xml配置+类内实现方法init_method ,destroy_method Bean注入和xml注入 2个方法来配置bean ? 1 . 解析xml/类路径扫描 2.注册 Bean 定义 3.依赖注入(根据bean的配置) 阅读全文
posted @ 2024-10-01 22:00 towboat 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1. 完全初始化的单例对象缓存(singletonObjects) 功能: 这个缓存用于存储已经完全初始化并可以使用的单例 bean 实例。 存储内容: 当一个 bean 完成初始化,包括所有的依赖注入和后处理之后,它会被放入这个缓存中。之后,对该 bean 的请求将直接返回这个缓存中的实例。 2. 阅读全文
posted @ 2024-10-01 14:41 towboat 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 使用: import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.After; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.an 阅读全文
posted @ 2024-10-01 12:53 towboat 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1. 定义接口 2.实现接口的具体类 3.创建 InvocationHandler 实现 import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; public class MyInvocationHan 阅读全文
posted @ 2024-10-01 12:24 towboat 阅读(0) 评论(0) 推荐(0) 编辑