Uses of Interface
org.miaixz.bus.core.lang.pool.Poolable
Packages that use Poolable
Package
Description
对象池封装实现
整体参考了:
https://github.com/DanielYWoo/fast-object-pool/
https://github.com/apache/commons-pool
基于分区的对象池实现,参考:https://github.com/DanielYWoo/fast-object-pool
-
Uses of Poolable in org.miaixz.bus.core.lang.pool
Methods in org.miaixz.bus.core.lang.pool that return PoolableModifier and TypeMethodDescriptionObjectPool.borrowObject()借出对象,流程如下: 从池中取出对象 检查对象可用性 如果无可用对象,扩容池并创建新对象 继续取对象Methods in org.miaixz.bus.core.lang.pool with parameters of type PoolableModifier and TypeMethodDescriptionObjectPool.returnObject(Poolable<T> obj) 归还对象,流程如下: 检查对象可用性 不可用则销毁之 可用则入池 -
Uses of Poolable in org.miaixz.bus.core.lang.pool.partition
Classes in org.miaixz.bus.core.lang.pool.partition that implement PoolableMethods in org.miaixz.bus.core.lang.pool.partition that return PoolableModifier and TypeMethodDescriptionPartitionObjectPool.borrowObject()PoolPartition.borrowObject()PoolPartition.createPoolable()Methods in org.miaixz.bus.core.lang.pool.partition that return types with arguments of type PoolableModifier and TypeMethodDescriptionprotected BlockingQueue<Poolable<T>> PartitionObjectPool.createBlockingQueue(PartitionPoolConfig poolConfig) 创建阻塞队列,默认为ArrayBlockingQueue如果需要自定义队列类型,子类重写此方法Methods in org.miaixz.bus.core.lang.pool.partition with parameters of type PoolableModifier and TypeMethodDescription销毁对象,注意此方法操作的对象必须在队列外PartitionObjectPool.returnObject(Poolable<T> obj) PoolPartition.returnObject(Poolable<T> poolable) 归还对象Constructor parameters in org.miaixz.bus.core.lang.pool.partition with type arguments of type PoolableModifierConstructorDescriptionPoolPartition(PoolConfig config, BlockingQueue<Poolable<T>> queue, ObjectFactory<T> objectFactory) 构造