org.ow2.util.pool.impl.enhanced.impl.limited.clue
Class LimitedWaiterCluePool<E,C>

java.lang.Object
  extended by org.ow2.util.pool.impl.enhanced.impl.limited.LimitedWaiterPool<E>
      extended by org.ow2.util.pool.impl.enhanced.impl.limited.clue.LimitedWaiterCluePool<E,C>
Type Parameters:
E - pool item type
C - clue type
All Implemented Interfaces:
ICluePool<E,C>, IPool<E>

public class LimitedWaiterCluePool<E,C>
extends LimitedWaiterPool<E>
implements ICluePool<E,C>

Author:
Gael Lalire

Field Summary
 
Fields inherited from class org.ow2.util.pool.impl.enhanced.impl.limited.LimitedWaiterPool
NO_LIMIT_WAITER
 
Constructor Summary
LimitedWaiterCluePool(ICluePool<E,C> cluePool)
           
LimitedWaiterCluePool(ICluePool<E,C> cluePool, int maxWaiter)
           
LimitedWaiterCluePool(ICluePool<E,C> cluePool, int maxWaiter, int maxClueWaiter, int maxNoClueWaiter)
           
 
Method Summary
protected  void addClueWaiter()
           
protected  void addNoClueWaiter()
           
 E get(C clue, IWaitControl timeout)
           
 E get(IWaitControl timeout)
          This method block is there is no available pool item in the pool.
protected  void removeClueWaiter()
           
protected  void removeNoClueWaiter()
           
 void waitEmptyClueWaiterInPool()
           
 void waitEmptyNoClueWaiterInPool()
           
 
Methods inherited from class org.ow2.util.pool.impl.enhanced.impl.limited.LimitedWaiterPool
addWaiter, put, remove, removeWaiter, setMaxWaiter, signalAllWaiters, waitEmptyWaiterInPool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.util.pool.impl.enhanced.api.IPool
put, remove, signalAllWaiters
 

Constructor Detail

LimitedWaiterCluePool

public LimitedWaiterCluePool(ICluePool<E,C> cluePool)

LimitedWaiterCluePool

public LimitedWaiterCluePool(ICluePool<E,C> cluePool,
                             int maxWaiter)

LimitedWaiterCluePool

public LimitedWaiterCluePool(ICluePool<E,C> cluePool,
                             int maxWaiter,
                             int maxClueWaiter,
                             int maxNoClueWaiter)
Method Detail

get

public E get(IWaitControl timeout)
      throws PoolException,
             java.lang.InterruptedException
Description copied from interface: IPool
This method block is there is no available pool item in the pool.

Specified by:
get in interface IPool<E>
Overrides:
get in class LimitedWaiterPool<E>
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

addClueWaiter

protected void addClueWaiter()
                      throws TooManyWaiterException
Throws:
TooManyWaiterException

removeClueWaiter

protected void removeClueWaiter()
                         throws TooManyWaiterException
Throws:
TooManyWaiterException

addNoClueWaiter

protected void addNoClueWaiter()
                        throws TooManyWaiterException
Throws:
TooManyWaiterException

removeNoClueWaiter

protected void removeNoClueWaiter()
                           throws TooManyWaiterException
Throws:
TooManyWaiterException

get

public E get(C clue,
             IWaitControl timeout)
      throws PoolException,
             java.lang.InterruptedException
Specified by:
get in interface ICluePool<E,C>
Throws:
PoolException
java.lang.InterruptedException

waitEmptyClueWaiterInPool

public void waitEmptyClueWaiterInPool()
                               throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

waitEmptyNoClueWaiterInPool

public void waitEmptyNoClueWaiterInPool()
                                 throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException


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