public class Pool extends Object implements LifeCycle, Serializable
| Modifier and Type | Class and Description |
|---|---|
static interface |
Pool.PondLife |
| Constructor and Description |
|---|
Pool() |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
dump(String msg) |
Pool.PondLife |
get(int timeoutMs) |
Object |
getAttribute(String name) |
int |
getMaxIdleTimeMs() |
int |
getMaxSize() |
int |
getMinSize() |
static Pool |
getPool(String name) |
Class |
getPoolClass() |
String |
getPoolName() |
boolean |
isStarted() |
void |
put(Pool.PondLife pl) |
void |
setAttribute(String name,
Object value) |
void |
setMaxIdleTimeMs(int maxIdleTimeMs) |
void |
setMaxSize(int max) |
void |
setMinSize(int min) |
void |
setPoolClass(Class poolClass)
Set the class.
|
void |
setPoolName(String name) |
void |
shrink() |
int |
size() |
void |
start()
Start the LifeCycle.
|
void |
stop()
Stop the LifeCycle.
|
public String getPoolName()
public void setPoolName(String name) throws IllegalStateException
name - The pool nameIllegalStateException - If the name is already defined.public void setPoolClass(Class poolClass) throws IllegalStateException
poolClass - The classIllegalStateException - If the pool has already
been started.public Class getPoolClass()
public int getMinSize()
public void setMinSize(int min)
public int getMaxSize()
public void setMaxSize(int max)
public int getMaxIdleTimeMs()
public void setMaxIdleTimeMs(int maxIdleTimeMs)
public boolean isStarted()
public int size()
public int available()
public void start()
throws Exception
LifeCyclepublic void stop()
throws InterruptedException
LifeCyclestop in interface LifeCycleInterruptedException - Stopping a lifecycle is rarely atomic
and may be interrupted by another thread. If this happens
InterruptedException is throw and the component will be in an
indeterminant state and should probably be discarded.public Pool.PondLife get(int timeoutMs) throws Exception
Exceptionpublic void put(Pool.PondLife pl) throws InterruptedException
InterruptedExceptionpublic void shrink()
throws InterruptedException
InterruptedExceptionpublic void dump(String msg)
Copyright © 2014. All rights reserved.