public class Pool
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Pool.Factory |
Modifier and Type | Field and Description |
---|---|
private Pool.Factory |
factory |
private int |
initialPoolSize |
private int |
maxPoolSize |
private java.lang.Object |
mutex |
private int |
nextAvailable |
private java.lang.Object[] |
pool |
Constructor and Description |
---|
Pool(int initialPoolSize,
int maxPoolSize,
Pool.Factory factory) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
fetchFromPool() |
protected void |
putInPool(java.lang.Object object) |
private java.lang.Object |
readResolve() |
private final int initialPoolSize
private final int maxPoolSize
private final Pool.Factory factory
private transient java.lang.Object[] pool
private transient int nextAvailable
private transient java.lang.Object mutex
public Pool(int initialPoolSize, int maxPoolSize, Pool.Factory factory)