org.openejb.core.stateless
Class StatelessInstanceManager

java.lang.Object
  |
  +--org.openejb.core.stateless.StatelessInstanceManager

public class StatelessInstanceManager
extends java.lang.Object

This instance manager has a pool limit for each bean class the pooling policy applies to how many beans maybe pooled in the method ready; it will always return a bean instance for every thread (no waiting for available instances). Instances returning to the pool are removed if pool is already full. Automatic pool reduction will require the the ejbRemove method be invoked. setSessionContext must be done within the instance manager


Inner Class Summary
(package private)  class StatelessInstanceManager.PoolQueue
           
(package private)  class StatelessInstanceManager.StackHolder
           
 
Field Summary
protected  int beanCount
           
protected  int poolLimit
           
protected  java.util.HashMap poolMap
           
protected  StatelessInstanceManager.PoolQueue poolQueue
           
protected  boolean strictPooling
           
protected  SafeToolkit toolkit
           
 
Constructor Summary
StatelessInstanceManager()
          CONSTRUCTOR METHODS
 
Method Summary
 void discardInstance(ThreadContext callContext, javax.ejb.EnterpriseBean bean)
          This methods cleans up benas that threw a system exception.
 void freeInstance(ThreadContext callContext, javax.ejb.EnterpriseBean bean)
           
 javax.ejb.EnterpriseBean getInstance(ThreadContext callContext)
           
 void init(java.util.Properties props)
           
 void poolInstance(ThreadContext callContext, javax.ejb.EnterpriseBean bean)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

poolMap

protected java.util.HashMap poolMap

poolLimit

protected int poolLimit

beanCount

protected int beanCount

strictPooling

protected boolean strictPooling

poolQueue

protected StatelessInstanceManager.PoolQueue poolQueue

toolkit

protected SafeToolkit toolkit
Constructor Detail

StatelessInstanceManager

public StatelessInstanceManager()
CONSTRUCTOR METHODS
Method Detail

init

public void init(java.util.Properties props)
          throws OpenEJBException

getInstance

public javax.ejb.EnterpriseBean getInstance(ThreadContext callContext)
                                     throws OpenEJBException

poolInstance

public void poolInstance(ThreadContext callContext,
                         javax.ejb.EnterpriseBean bean)
                  throws OpenEJBException

freeInstance

public void freeInstance(ThreadContext callContext,
                         javax.ejb.EnterpriseBean bean)

discardInstance

public void discardInstance(ThreadContext callContext,
                            javax.ejb.EnterpriseBean bean)
This methods cleans up benas that threw a system exception. EJB 2.0, page 376. note C: " Discard instance means that the Container must not invoke any business methods or container callbacks on the instance."