org.objectweb.perseus.pool.lib
Class ArrayListPool
java.lang.Object
org.objectweb.perseus.pool.lib.ArrayListPool
- AttributeController, BindingController, Pool, PoolAttributes
public class ArrayListPool
extends java.lang.Object
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 a TTL for the free pooled resources,
but by default the resource has not a TTL (0 value).
- S.Chassande-Barrioz
void | bindFc(String clientItfName, Object serverItf)
|
int | getMaxSize() - getMaxSize retrieves the maximum size assigned to this Pool.
|
int | getMinSize() - getMinSize retrieves the minimum size assigned to this Pool.
|
Object | getResource(Object hints) - getResource is used to allocate a PoolResource from the Pool.
|
Object | getResource(Object hints, Object user) - getResource is used to allocate a PoolResource from the Pool.
|
int | getSize()
|
long | getTTL() - getTTL retrieves the time to live of pool
resources (in milisecond).
|
long | getTimeout() - getTimeout retrieves the timeout assigned to this Pool.
|
String[] | listFc()
|
Object | lookupFc(String clientItfName)
|
void | releaseResource(Object resource) - releaseResource releases a PoolResource in order to allow the
Pool to recycle this PoolResource.
|
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.
|
void | unbindFc(String clientItfName)
|
DEFAULT_MAX_SIZE
public static final int DEFAULT_MAX_SIZE
The default maximum size of the pool: UNLIMITED
- -1
DEFAULT_MIN_SIZE
public static final int DEFAULT_MIN_SIZE
The default minimum size of the pool: 0
- 0
DEFAULT_TIME_OUT
public static final int DEFAULT_TIME_OUT
The default time out for a request: 100ms
- 300
DEPENDENCY_GRAPH_BINDING
public static final String DEPENDENCY_GRAPH_BINDING
POOL_MATCH_FACTORY_BINDING
public static final String POOL_MATCH_FACTORY_BINDING
UNLIMITED
public static final int UNLIMITED
The int value used for the timeout or the max size
- -1
bindFc
public void bindFc(String clientItfName,
Object serverItf)
getMaxSize
public int getMaxSize()
getMaxSize retrieves the maximum size assigned to this Pool.
- getMaxSize in interface PoolAttributes
- The maximum size currently assigned to this Pool.
getMinSize
public int getMinSize()
getMinSize retrieves the minimum size assigned to this Pool.
- getMinSize in interface PoolAttributes
- The minimum size currently assigned to this Pool.
getResource
public Object getResource(Object hints)
throws PoolException
getResource is used to allocate a PoolResource from the Pool.
Some hints are passed in order to specialise the matching or creation
of PoolResource.
- getResource in interface Pool
hints
- Some properties to specialise the matching or the creation
of PoolResource.
- The PoolResource allocated from the Pool.
getResource
public Object getResource(Object hints,
Object user)
throws PoolException,
DeadLockException
getResource is used to allocate a PoolResource from the Pool.
Some hints are passed in order to specialise the matching or creation
of PoolResource. The user parameter avoids dead lock by the use of a
dependency graph.
- 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.
- The PoolResource allocated from the Pool.
getSize
public int getSize()
- getSize in interface Pool
- the number resource used and free
getTTL
public long getTTL()
getTTL retrieves the time to live of pool
resources (in milisecond).
- getTTL in interface PoolAttributes
getTimeout
public long getTimeout()
getTimeout retrieves the timeout assigned to this Pool.
- getTimeout in interface PoolAttributes
- The timeout currently assigned to this Pool.
listFc
public String[] listFc()
lookupFc
public Object lookupFc(String clientItfName)
releaseResource
public void releaseResource(Object resource)
throws PoolException
releaseResource releases a PoolResource in order to allow the
Pool to recycle this PoolResource.
- releaseResource in interface Pool
resource
- The PoolResource to be released.
setMaxSize
public void setMaxSize(int maxsize)
throws Exception
setMaxSize assigns a maximum size to this Pool.
- setMaxSize in interface PoolAttributes
maxsize
- The maximum size to be assigned.
setMinSize
public void setMinSize(int minsize)
throws Exception
setMinSize assigns a minimum size to this Pool.
- setMinSize in interface PoolAttributes
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.
- setTTL in interface PoolAttributes
setTimeout
public void setTimeout(long crto)
setTimeout assigns a timeout to this Pool.
- setTimeout in interface PoolAttributes
crto
- The timeout to be assigned.
unbindFc
public void unbindFc(String clientItfName)
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.