|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.perseus.pool.lib.ArrayListPool
The class LArrayPool implements a Pool as an array of PoolResource, managing free/active resources through two ArrayList objects. An unlimited size and a timeout features are supported. This implementation is thread safe. This implementation is able to manage an InactiveTTL for the free pooled resources, but by default the resource has not a TTL (negative value). This implementation is able to manage a TTL for each pooled resources, but by default the resource has not a TTL (negative value).
Field Summary | |
static int |
DEFAULT_MAX_SIZE
The default maximum size of the pool: UNLIMITED |
static int |
DEFAULT_MIN_SIZE
The default minimum size of the pool: 0 |
static int |
DEFAULT_TIME_OUT
The default time out for a request: 100ms |
static java.lang.String |
DEPENDENCY_GRAPH_BINDING
|
static java.lang.String |
POOL_MATCH_FACTORY_BINDING
|
static int |
UNLIMITED
The int value used for the timeout or the max size |
Constructor Summary | |
ArrayListPool()
|
Method Summary | |
void |
bindFc(java.lang.String clientItfName,
java.lang.Object serverItf)
|
int |
getFreeResourceNumber()
|
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. |
java.lang.Object |
getResource(java.lang.Object hints)
getResource is used to allocate a PoolResource from the Pool. |
java.lang.Object |
getResource(java.lang.Object hints,
java.lang.Object user)
getResource is used to allocate a PoolResource from the Pool. |
int |
getSize()
|
long |
getTimeout()
getTimeout retrieves the timeout assigned to this Pool. |
long |
getTTL()
getTTL retrieves the time to live of pool resources (in milisecond). |
int |
getUsedResourceNumber()
|
java.util.Collection |
getUsers()
|
java.lang.String[] |
listFc()
|
java.lang.Object |
lookupFc(java.lang.String clientItfName)
|
void |
releaseResource(java.lang.Object resource)
releaseResource releases a PoolResource in order to allow the Pool to recycle this PoolResource. |
void |
setInactiveTTL(long fttl)
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. |
void |
unbindFc(java.lang.String clientItfName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String POOL_MATCH_FACTORY_BINDING
public static final java.lang.String DEPENDENCY_GRAPH_BINDING
public static final int UNLIMITED
public static final int DEFAULT_MIN_SIZE
public static final int DEFAULT_MAX_SIZE
public static final int DEFAULT_TIME_OUT
Constructor Detail |
public ArrayListPool()
Method Detail |
public java.lang.String[] listFc()
public java.lang.Object lookupFc(java.lang.String clientItfName)
public void bindFc(java.lang.String clientItfName, java.lang.Object serverItf)
public void unbindFc(java.lang.String clientItfName)
public java.lang.Object getResource(java.lang.Object hints) throws PoolException
getResource
in interface Pool
hints
- Some properties to specialise the matching or the creation
of PoolResource.
PoolException
public java.lang.Object getResource(java.lang.Object hints, java.lang.Object user) throws PoolException, DeadLockException
Pool
getResource
in interface Pool
hints
- Some properties to specialise the matching or the creation
of PoolResource.user
- is an identifier of the context wanting a resource in the
pool.
PoolException
DeadLockException
public int getSize()
getSize
in interface Pool
public int getFreeResourceNumber()
getFreeResourceNumber
in interface Pool
public int getUsedResourceNumber()
getUsedResourceNumber
in interface Pool
public java.util.Collection getUsers()
getUsers
in interface Pool
public void releaseResource(java.lang.Object resource) throws PoolException
releaseResource
in interface Pool
resource
- The PoolResource to be released.
PoolException
public long getTimeout()
getTimeout
in interface PoolAttributes
public int getMinSize()
getMinSize
in interface PoolAttributes
public int getMaxSize()
getMaxSize
in interface PoolAttributes
public void setTimeout(long crto)
setTimeout
in interface PoolAttributes
crto
- The timeout to be assigned.public void setMinSize(int minsize) throws java.lang.Exception
setMinSize
in interface PoolAttributes
minsize
- The minimum size to be assigned.
java.lang.Exception
public void setMaxSize(int maxsize) throws java.lang.Exception
setMaxSize
in interface PoolAttributes
maxsize
- The maximum size to be assigned.
java.lang.Exception
public long getTTL()
PoolAttributes
getTTL
in interface PoolAttributes
public void setTTL(long ttl)
PoolAttributes
setTTL
in interface PoolAttributes
public long getInactiveTTL()
PoolAttributes
getInactiveTTL
in interface PoolAttributes
public void setInactiveTTL(long fttl)
PoolAttributes
setInactiveTTL
in interface PoolAttributes
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |