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
LifeCycle
public void stop() throws InterruptedException
LifeCycle
stop
in interface LifeCycle
InterruptedException
- 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
Exception
public void put(Pool.PondLife pl) throws InterruptedException
InterruptedException
public void shrink() throws InterruptedException
InterruptedException
public void dump(String msg)
Copyright © 2013. All rights reserved.