Example usage for org.apache.commons.pool.impl GenericObjectPool WHEN_EXHAUSTED_FAIL

List of usage examples for org.apache.commons.pool.impl GenericObjectPool WHEN_EXHAUSTED_FAIL

Introduction

In this page you can find the example usage for org.apache.commons.pool.impl GenericObjectPool WHEN_EXHAUSTED_FAIL.

Prototype

byte WHEN_EXHAUSTED_FAIL

To view the source code for org.apache.commons.pool.impl GenericObjectPool WHEN_EXHAUSTED_FAIL.

Click Source Link

Document

A "when exhausted action" type indicating that when the pool is exhausted (i.e., the maximum number of active objects has been reached), the #borrowObject method should fail, throwing a NoSuchElementException .

Usage

From source file:org.yosemite.jcsadra.impl.SimpleCassandraClientPool.java

public static byte getObjectPoolExhaustedAction(ExhaustedAction exhaustedAction) {
    switch (exhaustedAction) {
    case WHEN_EXHAUSTED_FAIL:
        return GenericObjectPool.WHEN_EXHAUSTED_FAIL;
    case WHEN_EXHAUSTED_BLOCK:
        return GenericObjectPool.WHEN_EXHAUSTED_BLOCK;
    case WHEN_EXHAUSTED_GROW:
        return GenericObjectPool.WHEN_EXHAUSTED_GROW;
    default:/*  w  w w  . ja  v  a2  s. c  o m*/
        return GenericObjectPool.WHEN_EXHAUSTED_BLOCK;
    }
}