org.objectweb.perseus.pool.api
Interface Pool
- ArrayListPool, LArrayPool
The interface Pool defines an object that pools resources of any
kind. Resources must be requested (getResource) and released
(releaseResource) on demand. A Pool object can be parameterized along
different dimensions. All these dimensions are represented by PoolAttributes
interface.
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()
|
void | releaseResource(Object resource)- releaseResource releases a PoolResource in order to allow the
Pool to recycle this PoolResource.
|
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.
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.
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()
- the number resource used and free
releaseResource
public void releaseResource(Object resource)
throws PoolException releaseResource releases a PoolResource in order to allow the
Pool to recycle this PoolResource.
resource - The PoolResource to be released.
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.