org.objectweb.perseus.pool.api
Interface PoolAttributes
- AttributeController
- ArrayListPool, LArrayPool
public interface PoolAttributes
extends AttributeController
This interafece contains the accessor methods (getters and setters) which
permit to tune a Pool:
-
A Timeout can be assigned to a Pool. It is used when no more
PoolResource is available and when the Pool has reached its maximum size.
This is the timeout to wait for a free PoolResource until exting with an
exception. It defaults to 0, which means waiting forever until a
PoolResource is freed. Its value should be greater or equal to 0 ; negative
values are ignored (setTimeOut(-1) => NOP).
-
A MinSize can be assigned to a Pool. Its value should be greater or
equal to 0, and smaller or equal to MaxSize. Values that do not match these
conditions are ignored (e.g., setMinSize(-1) => NOP).
This size means that there is always MinSize PoolResource allocated in this
Pool. If PoolResource needs to be allocated when setting this size,
"getPoolMatchFactory().createResource(null)" is called. Its default value
is 0.
-
A MaxSize can be assigned to a Pool. Its value should be greater or
equal to 0, and greater or equal to MinSize. Values that do not match these
conditions are ignored (e.g., setMaxSize(-1) => NOP). Its default value
is 0, thus it is mandatory to set this value for making the Poll functional.
- S.Chassande-Barrioz
int | getMaxSize() - getMaxSize retrieves the maximum size assigned to this Pool.
|
int | getMinSize() - getMinSize retrieves the minimum size assigned to this Pool.
|
long | getTTL() - getTTL retrieves the time to live of pool
resources (in milisecond).
|
long | getTimeout() - getTimeout retrieves the timeout assigned to this Pool.
|
void | setMaxSize(int maxsize) - setMaxSize assigns a maximum size to this Pool.
|
void | setMinSize(int minsize) - setMinSize assigns a minimum size to this Pool.
|
void | setTTL(long ttl) - setTTL assignes the time (in milisecond) to live of pool
resources.
|
void | setTimeout(long crto) - setTimeout assigns a timeout to this Pool.
|
getMaxSize
public int getMaxSize()
getMaxSize retrieves the maximum size assigned to this Pool.
- The maximum size currently assigned to this Pool.
getMinSize
public int getMinSize()
getMinSize retrieves the minimum size assigned to this Pool.
- The minimum size currently assigned to this Pool.
getTTL
public long getTTL()
getTTL retrieves the time to live of pool
resources (in milisecond).
getTimeout
public long getTimeout()
getTimeout retrieves the timeout assigned to this Pool.
- The timeout currently assigned to this Pool.
setMaxSize
public void setMaxSize(int maxsize)
throws Exception
setMaxSize assigns a maximum size to this Pool.
maxsize
- The maximum size to be assigned.
setMinSize
public void setMinSize(int minsize)
throws Exception
setMinSize assigns a minimum size to this Pool.
minsize
- The minimum size to be assigned.
setTTL
public void setTTL(long ttl)
setTTL assignes the time (in milisecond) to live of pool
resources. If the value is lesser or equal to 0 then pool resources do
not have a TTL.
setTimeout
public void setTimeout(long crto)
setTimeout assigns a timeout to this Pool.
crto
- The timeout to be assigned.
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.