org.objectweb.perseus.pool.lib

Class LArrayPool

Implemented Interfaces:
AttributeController, BindingController, Pool, PoolAttributes

public class LArrayPool
extends java.lang.Object
implements Pool, PoolAttributes, BindingController

The class LArrayPool implements a Pool as an array of PoolResource, managing free/active resources through lists of cells encapsulating the resources.

Author:
P.Dechamboux

Field Summary

static String
POOL_MATCH_FACTORY_BINDING

Method Summary

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)
Object
getResource(Object hints, Object user)
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)
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)

Field Details

POOL_MATCH_FACTORY_BINDING

public static final String POOL_MATCH_FACTORY_BINDING

Method Details

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)


getMaxSize

public int getMaxSize()
getMaxSize retrieves the maximum size assigned to this Pool.
Specified by:
getMaxSize in interface PoolAttributes

Returns:
The maximum size currently assigned to this Pool.


getMinSize

public int getMinSize()
getMinSize retrieves the minimum size assigned to this Pool.
Specified by:
getMinSize in interface PoolAttributes

Returns:
The minimum size currently assigned to this Pool.


getResource

public Object getResource(Object hints)
            throws PoolException
Specified by:
getResource in interface Pool


getResource

public Object getResource(Object hints,
                          Object user)
            throws PoolException
Specified by:
getResource in interface Pool


getSize

public int getSize()
Specified by:
getSize in interface Pool


getTTL

public long getTTL()
getTTL retrieves the time to live of pool resources (in milisecond).
Specified by:
getTTL in interface PoolAttributes


getTimeout

public long getTimeout()
getTimeout retrieves the timeout assigned to this Pool.
Specified by:
getTimeout in interface PoolAttributes

Returns:
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
Specified by:
releaseResource in interface Pool


setMaxSize

public void setMaxSize(int maxsize)
setMaxSize assigns a maximum size to this Pool.
Specified by:
setMaxSize in interface PoolAttributes

Parameters:
maxsize - The maximum size to be assigned.


setMinSize

public void setMinSize(int minsize)
setMinSize assigns a minimum size to this Pool.
Specified by:
setMinSize in interface PoolAttributes

Parameters:
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.
Specified by:
setTTL in interface PoolAttributes


setTimeout

public void setTimeout(long crto)
setTimeout assigns a timeout to this Pool.
Specified by:
setTimeout in interface PoolAttributes

Parameters:
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.