Enum Class PooledObjectState
- All Implemented Interfaces:
Serializable, Comparable<PooledObjectState>, Constable
PooledObjectState - Pooled Object State Enumeration
PooledObjectState - 池化对象状态枚举
Defines the lifecycle states of a pooled object.
定义池化对象的生命周期状态。
State Transitions | 状态转换:
IDLE -> ALLOCATED (borrow)
ALLOCATED -> RETURNING -> IDLE (return)
IDLE -> EVICTION -> INVALID (evict)
ALLOCATED -> INVALID (invalidate)
Any -> ABANDONED (timeout detection)
Features | 主要功能:
- State tracking for pooled objects - 池化对象状态追踪
- Thread-safe state transitions - 线程安全的状态转换
- Lifecycle management support - 生命周期管理支持
Usage Examples | 使用示例:
PooledObjectState state = pooledObject.getState();
if (state == PooledObjectState.IDLE) {
// Object available for borrowing
}
- Since:
- JDK 25, opencode-base-pool V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionObject has been abandoned (not returned within timeout).Object has been allocated to a client.Object is being evicted from the pool.Object is idle in the pool, available for borrowing.Object has been invalidated and will be destroyed.Object is being returned to the pool.Object is being validated. -
Method Summary
Modifier and TypeMethodDescriptionstatic PooledObjectStateReturns the enum constant of this class with the specified name.static PooledObjectState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
IDLE
Object is idle in the pool, available for borrowing. 对象空闲在池中,可被借用。 -
ALLOCATED
Object has been allocated to a client. 对象已被分配给客户端。 -
EVICTION
Object is being evicted from the pool. 对象正在被从池中驱逐。 -
VALIDATION
Object is being validated. 对象正在被验证。 -
INVALID
Object has been invalidated and will be destroyed. 对象已失效,将被销毁。 -
RETURNING
Object is being returned to the pool. 对象正在被归还到池中。 -
ABANDONED
Object has been abandoned (not returned within timeout). 对象已被废弃(超时未归还)。
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-