org.openejb.core.stateless
Class StatelessInstanceManager

java.lang.Object
  extended by 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


Field Summary
protected  int beanCount
           
protected static org.apache.log4j.Category logger
           
protected  int poolLimit
           
protected  java.util.HashMap poolMap
           
protected  org.openejb.core.stateless.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 org.openejb.core.stateless.StatelessInstanceManager.PoolQueue poolQueue

toolkit

protected final SafeToolkit toolkit

logger

protected static final org.apache.log4j.Category logger
Constructor Detail

StatelessInstanceManager

public StatelessInstanceManager()
CONSTRUCTOR METHODS

Method Detail

init

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

getInstance

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

poolInstance

public void poolInstance(ThreadContext callContext,
                         javax.ejb.EnterpriseBean bean)
                  throws OpenEJBException
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."



Copyright © 1999-2011 OpenEJB. All Rights Reserved.