1 module geario.util.pool.PooledObjectState; 2 3 4 5 /** 6 * Provides the possible states that a {@link PooledObject} may be in. 7 * 8 */ 9 enum PooledObjectState { 10 /** 11 * In the queue, not in use. 12 */ 13 IDLE, 14 15 /** 16 * In use. 17 */ 18 ALLOCATED, 19 20 // /** 21 // * In the queue, currently being tested for possible eviction. 22 // */ 23 // EVICTION, 24 25 // /** 26 // * Not in the queue, currently being tested for possible eviction. An 27 // * attempt to borrow the object was made while being tested which removed it 28 // * from the queue. It should be returned to the head of the queue once 29 // * eviction testing completes. 30 // * TODO: Consider allocating object and ignoring the result of the eviction 31 // * test. 32 // */ 33 // EVICTION_RETURN_TO_HEAD, 34 35 // /** 36 // * In the queue, currently being validated. 37 // */ 38 // VALIDATION, 39 40 // /** 41 // * Not in queue, currently being validated. The object was borrowed while 42 // * being validated and since testOnBorrow was configured, it was removed 43 // * from the queue and pre-allocated. It should be allocated once validation 44 // * completes. 45 // */ 46 // VALIDATION_PREALLOCATED, 47 48 // /** 49 // * Not in queue, currently being validated. An attempt to borrow the object 50 // * was made while previously being tested for eviction which removed it from 51 // * the queue. It should be returned to the head of the queue once validation 52 // * completes. 53 // */ 54 // VALIDATION_RETURN_TO_HEAD, 55 56 /** 57 * Failed maintenance (e.g. eviction test or validation) and will be / has 58 * been destroyed 59 */ 60 INVALID, 61 62 /** 63 * Deemed abandoned, to be invalidated. 64 */ 65 ABANDONED, 66 67 /** 68 * Returning to the pool. 69 */ 70 RETURNING 71 }