org.ow2.util.pool.impl.enhanced.api
Interface IPool<E>

Type Parameters:
E - pool item type
All Known Subinterfaces:
IBasicCluePool<E,C>, IBasicPool<E>, ICluePool<E,C>, IRecorderCluePool<E,C>, IRecorderPool<E>, IResizableCluePool<E,C>, IResizablePool<E>
All Known Implementing Classes:
BasicCluePool, BasicPool, CluePoolListenerDispatcherPool, KeepBusyCluePool, KeepBusyPool, LimitedWaiterCluePool, LimitedWaiterPool, PoolListenerDispatcherPool, StatsResizerCluePool, StatsResizerPool, ValidatorCluePool, ValidatorPool

public interface IPool<E>

A pool is a class which keep some pool item.

Author:
Gael Lalire

Method Summary
 E get(IWaitControl timeout)
          This method block is there is no available pool item in the pool.
 void put(E poolItem)
          This method must be called when you finished to use the pool item.
 void remove(E poolItem)
          This method can be called when you finished to use the pool item instead of put method.
 void signalAllWaiters()
          Ask pool to recall all timeout.waitOnXXX.
 

Method Detail

get

E get(IWaitControl timeout)
      throws PoolException,
             java.lang.InterruptedException
This method block is there is no available pool item in the pool.

Parameters:
timeout - if the get wait more than timeout then the method throw a TimeoutPoolException.
Returns:
a pool item
Throws:
PoolException - if error occurs
java.lang.InterruptedException

put

void put(E poolItem)
         throws NotABusyPoolItemException
This method must be called when you finished to use the pool item.

Parameters:
poolItem - a pool item
Throws:
NotABusyPoolItemException - if error occurs

remove

void remove(E poolItem)
            throws NotABusyPoolItemException
This method can be called when you finished to use the pool item instead of put method. If you call this method the pool item will be replace with a new.

Parameters:
poolItem - a pool item
Throws:
NotABusyPoolItemException - if error occurs

signalAllWaiters

void signalAllWaiters()
Ask pool to recall all timeout.waitOnXXX. So if you change a WaitAuthorization state you can avoid all waiters.



Copyright © 2007-2009 OW2 Consortium. All Rights Reserved.