org.objectweb.perseus.pool.api
Interface PoolAttributes
- All Known Implementing Classes:
- ArrayListPool, LArrayPool
- public interface PoolAttributes
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.
- Author:
- S.Chassande-Barrioz
Method Summary |
long |
getInactiveTTL()
getTTL retrieves the time to live of pool
resources when they are unused (in milisecond). |
int |
getMaxSize()
getMaxSize retrieves the maximum size assigned to this Pool. |
int |
getMinSize()
getMinSize retrieves the minimum size assigned to this Pool. |
long |
getTimeout()
getTimeout retrieves the timeout assigned to this Pool. |
long |
getTTL()
getTTL retrieves the time to live of pool
resources (in milisecond). |
void |
setInactiveTTL(long ttl)
setTTL assignes the time (in milisecond) to live of pool
resources when they are unused. |
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 |
setTimeout(long crto)
setTimeout assigns a timeout to this Pool. |
void |
setTTL(long ttl)
setTTL assignes the time (in milisecond) to live of pool
resources. |
getTimeout
public long getTimeout()
- getTimeout retrieves the timeout assigned to this Pool.
- Returns:
- The timeout currently assigned to this Pool.
getMinSize
public int getMinSize()
- getMinSize retrieves the minimum size assigned to this Pool.
- Returns:
- The minimum size currently assigned to this Pool.
getMaxSize
public int getMaxSize()
- getMaxSize retrieves the maximum size assigned to this Pool.
- Returns:
- The maximum size currently assigned to this Pool.
getTTL
public long getTTL()
- getTTL retrieves the time to live of pool
resources (in milisecond).
getInactiveTTL
public long getInactiveTTL()
- getTTL retrieves the time to live of pool
resources when they are unused (in milisecond).
setTimeout
public void setTimeout(long crto)
- setTimeout assigns a timeout to this Pool.
- Parameters:
crto
- The timeout to be assigned.
setMinSize
public void setMinSize(int minsize)
throws java.lang.Exception
- setMinSize assigns a minimum size to this Pool.
- Parameters:
minsize
- The minimum size to be assigned.
- Throws:
java.lang.Exception
setMaxSize
public void setMaxSize(int maxsize)
throws java.lang.Exception
- setMaxSize assigns a maximum size to this Pool.
- Parameters:
maxsize
- The maximum size to be assigned.
- Throws:
java.lang.Exception
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.
setInactiveTTL
public void setInactiveTTL(long ttl)
- setTTL assignes the time (in milisecond) to live of pool
resources when they are unused. If the value is lesser or equal to 0
then pool resources do not have a TTL.
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.