org.jboss.ejb3.pool
Class StrictMaxPool

java.lang.Object
  extended by org.jboss.ejb3.pool.AbstractPool
      extended by org.jboss.ejb3.pool.StrictMaxPool
All Implemented Interfaces:
Pool

public class StrictMaxPool
extends AbstractPool

Version:
$Revision: 87930 $
Author:
Kabir Khan

Field Summary
static int DEFAULT_MAX_SIZE
           
static long DEFAULT_TIMEOUT
           
protected  int maxSize
          The maximum number of instances allowed in the pool
protected  LinkedList pool
          The pool data structure
 
Fields inherited from class org.jboss.ejb3.pool.AbstractPool
container, createCount, injectors, removeCount
 
Constructor Summary
StrictMaxPool()
           
 
Method Summary
 void destroy()
          Destroy the pool.
 void discard(BeanContext ctx)
          Discard the bean.
 BeanContext get()
          Get an instance without identity.
 BeanContext get(Class[] initTypes, Object[] initValues)
           
 int getAvailableCount()
           
 int getCurrentSize()
           
 int getMaxSize()
           
 void initialize(Container container, int maxSize, long timeout)
          super.initialize() must have been called in advance
 void release(BeanContext ctx)
          Return an instance after invocation.
 void remove(BeanContext ctx)
          Destroy bean.
 void setMaxSize(int maxSize)
           
 
Methods inherited from class org.jboss.ejb3.pool.AbstractPool
create, create, getCreateCount, getRemoveCount, setInjectors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_SIZE

public static final int DEFAULT_MAX_SIZE
See Also:
Constant Field Values

DEFAULT_TIMEOUT

public static final long DEFAULT_TIMEOUT
See Also:
Constant Field Values

pool

protected LinkedList pool
The pool data structure


maxSize

protected int maxSize
The maximum number of instances allowed in the pool

Constructor Detail

StrictMaxPool

public StrictMaxPool()
Method Detail

initialize

public void initialize(Container container,
                       int maxSize,
                       long timeout)
super.initialize() must have been called in advance

Specified by:
initialize in interface Pool
Overrides:
initialize in class AbstractPool

getCurrentSize

public int getCurrentSize()

getAvailableCount

public int getAvailableCount()

getMaxSize

public int getMaxSize()

setMaxSize

public void setMaxSize(int maxSize)
Specified by:
setMaxSize in interface Pool
Specified by:
setMaxSize in class AbstractPool

get

public BeanContext get()
Get an instance without identity. Can be used by finders,create-methods, and activation

Returns:
Context /w instance

get

public BeanContext get(Class[] initTypes,
                       Object[] initValues)

release

public void release(BeanContext ctx)
Return an instance after invocation.

Called in 2 cases: a) Done with finder method b) Just removed

Parameters:
ctx -

destroy

public void destroy()
Description copied from interface: Pool
Destroy the pool.


discard

public void discard(BeanContext ctx)
Description copied from interface: Pool
Discard the bean. Called in different context as remove. If there is a system exception this is called.

Specified by:
discard in interface Pool
Overrides:
discard in class AbstractPool

remove

public void remove(BeanContext ctx)
Description copied from interface: Pool
Destroy bean. ejbRemove callback is executed

Specified by:
remove in interface Pool
Overrides:
remove in class AbstractPool


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.