|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.util.Pool
A pool of Objects.
Nested Class Summary | |
static interface |
Pool.PondLife
|
Constructor Summary | |
Pool()
|
Method Summary | |
int |
available()
|
void |
dump(java.lang.String msg)
|
Pool.PondLife |
get(int timeoutMs)
|
java.lang.Object |
getAttribute(java.lang.String name)
|
int |
getMaxIdleTimeMs()
|
int |
getMaxSize()
|
int |
getMinSize()
|
static Pool |
getPool(java.lang.String name)
|
java.lang.Class |
getPoolClass()
|
java.lang.String |
getPoolName()
|
boolean |
isStarted()
|
void |
put(Pool.PondLife pl)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setMaxIdleTimeMs(int maxIdleTimeMs)
|
void |
setMaxSize(int max)
|
void |
setMinSize(int min)
|
void |
setPoolClass(java.lang.Class poolClass)
Set the class. |
void |
setPoolName(java.lang.String name)
|
void |
shrink()
|
int |
size()
|
void |
start()
Start the LifeCycle. |
void |
stop()
Stop the LifeCycle. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Pool()
Method Detail |
public static Pool getPool(java.lang.String name)
public java.lang.String getPoolName()
public void setPoolName(java.lang.String name) throws java.lang.IllegalStateException
name
- The pool name
java.lang.IllegalStateException
- If the name is already defined.public void setPoolClass(java.lang.Class poolClass) throws java.lang.IllegalStateException
poolClass
- The class
java.lang.IllegalStateException
- If the pool has already
been started.public java.lang.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 void setAttribute(java.lang.String name, java.lang.Object value)
public java.lang.Object getAttribute(java.lang.String name)
public boolean isStarted()
isStarted
in interface LifeCycle
public int size()
public int available()
public void start() throws java.lang.Exception
LifeCycle
start
in interface LifeCycle
java.lang.Exception
- An arbitrary exception may be thrown.public void stop() throws java.lang.InterruptedException
LifeCycle
stop
in interface LifeCycle
java.lang.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 java.lang.Exception
java.lang.Exception
public void put(Pool.PondLife pl) throws java.lang.InterruptedException
java.lang.InterruptedException
public void shrink() throws java.lang.InterruptedException
java.lang.InterruptedException
public void dump(java.lang.String msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |