org.ow2.util.pool.impl.enhanced
Class EnhancedPool<E>

java.lang.Object
  extended by org.ow2.util.pool.impl.enhanced.EnhancedPool<E>
Type Parameters:
E -

public class EnhancedPool<E>
extends java.lang.Object

Author:
Gael Lalire

Constructor Summary
EnhancedPool(IPoolManager<E> poolManager)
           
EnhancedPool(IPoolManager<E> poolManager, ResizerType resizerType, ISharedManager sharedManager, java.util.concurrent.Executor createAndRemoveItemExecutor)
           
 
Method Summary
protected  IWaitControl createWaitControl()
           
 void discard(E instance)
           
 void forceStop()
           
 E get()
           
 boolean isAllowSharedInstance()
          Return true if many instances of the same object can be created (when pool is not full).
 void release(E instance)
           
 void setAllowSharedInstance(boolean allowSharedInstance)
          Allow to share instances (shouldn't be use in stateful case as one stateful ID is linked to one client.
 void setPoolConfiguration(org.ow2.util.pool.api.IPoolConfiguration poolConfiguration)
           
 void start()
           
 void stop()
           
 void updatePoolSize()
          If you do not want to wait an action which resize the pool to create future needed pool item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnhancedPool

public EnhancedPool(IPoolManager<E> poolManager)

EnhancedPool

public EnhancedPool(IPoolManager<E> poolManager,
                    ResizerType resizerType,
                    ISharedManager sharedManager,
                    java.util.concurrent.Executor createAndRemoveItemExecutor)
Method Detail

createWaitControl

protected IWaitControl createWaitControl()

get

public E get()
      throws org.ow2.util.pool.api.PoolException
Throws:
org.ow2.util.pool.api.PoolException

discard

public void discard(E instance)
             throws org.ow2.util.pool.api.PoolException
Throws:
org.ow2.util.pool.api.PoolException

release

public void release(E instance)
             throws org.ow2.util.pool.api.PoolException
Throws:
org.ow2.util.pool.api.PoolException

updatePoolSize

public void updatePoolSize()
If you do not want to wait an action which resize the pool to create future needed pool item. This method can be use after a failed stop() to reconstruct missing items. Also after construction and start() ...


setPoolConfiguration

public void setPoolConfiguration(org.ow2.util.pool.api.IPoolConfiguration poolConfiguration)

setAllowSharedInstance

public void setAllowSharedInstance(boolean allowSharedInstance)
Allow to share instances (shouldn't be use in stateful case as one stateful ID is linked to one client. No Stateful with same ID are authorized).

Parameters:
allowSharedInstance - true if it is allowed, else false.

isAllowSharedInstance

public boolean isAllowSharedInstance()
Return true if many instances of the same object can be created (when pool is not full).

Returns:
true if this is allowed.

start

public void start()
           throws org.ow2.util.pool.api.PoolException
Throws:
org.ow2.util.pool.api.PoolException

forceStop

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

stop

public void stop()
          throws org.ow2.util.pool.api.PoolException
Throws:
org.ow2.util.pool.api.PoolException


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