Package org.jboss.as.ejb3.pool.strictmax
Class StrictMaxPool<T>
- java.lang.Object
-
- org.jboss.as.ejb3.pool.AbstractPool<T>
-
- org.jboss.as.ejb3.pool.strictmax.StrictMaxPool<T>
-
- All Implemented Interfaces:
Pool<T>
public class StrictMaxPool<T> extends AbstractPool<T>
A pool with a maximum size.- Author:
- Carlo de Wolf, Kabir Khan
-
-
Constructor Summary
Constructors Constructor Description StrictMaxPool(StatelessObjectFactory<T> factory, int maxSize, long timeout, TimeUnit timeUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddiscard(T ctx)Discard an object.Tget()Get an instance without identity.intgetAvailableCount()intgetCurrentSize()intgetMaxSize()voidrelease(T obj)Return an instance after invocation.voidremove(T ctx)Deprecated.voidsetMaxSize(int maxSize)voidstart()Start the pool.voidstop()Stop the pool.-
Methods inherited from class org.jboss.as.ejb3.pool.AbstractPool
create, destroy, doRemove, getCreateCount, getRemoveCount
-
-
-
-
Constructor Detail
-
StrictMaxPool
public StrictMaxPool(StatelessObjectFactory<T> factory, int maxSize, long timeout, TimeUnit timeUnit)
-
-
Method Detail
-
discard
public void discard(T ctx)
Description copied from interface:PoolDiscard an object. This will be called in case of a system exception.- Parameters:
ctx- the object
-
getCurrentSize
public int getCurrentSize()
-
getAvailableCount
public int getAvailableCount()
-
getMaxSize
public int getMaxSize()
-
setMaxSize
public void setMaxSize(int maxSize)
- Specified by:
setMaxSizein interfacePool<T>- Specified by:
setMaxSizein classAbstractPool<T>
-
get
public T get()
Get an instance without identity. Can be used by finders,create-methods, and activation- Returns:
- Context /w instance
-
release
public void release(T obj)
Return an instance after invocation. Called in 2 cases: a) Done with finder method b) Just removed- Parameters:
obj-
-
remove
@Deprecated public void remove(T ctx)
Deprecated.- Overrides:
removein classAbstractPool<T>
-
start
public void start()
Description copied from interface:PoolStart the pool.
-
stop
public void stop()
Description copied from interface:PoolStop the pool.
-
-