对象状态

对象池common-pool2源码分析之对象状态

梦想与她 提交于 2019-12-17 20:42:02
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 对象池common-pool2源码分析 对象池common-pool2策略分析 从前两篇的分析中可以看出对象池中的对象会被激活,钝化,销毁等 ,那么做这些操作的对象需要满足什么条件呢 ,与这些操作之后相对应的对象的状态是什么样的呢? 首先从PooledObjectState开始分析 public enum PooledObjectState { /** * In the queue, not in use. */ IDLE, /** * In use. */ ALLOCATED, /** * In the queue, currently being tested for possible eviction. */ EVICTION, /** * Not in the queue, currently being tested for possible eviction. An * attempt to borrow the object was made while being tested which removed it * from the queue. It should be returned to the head of the queue once * eviction testing