org.apache.openejb.core.stateless
Class StatelessInstanceManager

java.lang.Object
  extended by org.apache.openejb.core.stateless.StatelessInstanceManager

public class StatelessInstanceManager
extends Object


Field Summary
protected  int beanCount
           
protected  int poolLimit
           
protected  org.apache.openejb.core.stateless.StatelessInstanceManager.PoolQueue poolQueue
           
protected  boolean strictPooling
           
protected  SafeToolkit toolkit
           
 
Constructor Summary
StatelessInstanceManager(TransactionManager transactionManager, SecurityService securityService, int timeout, int poolSize, boolean strictPooling)
           
 
Method Summary
 void deploy(CoreDeploymentInfo deploymentInfo)
           
 void discardInstance(ThreadContext callContext, Object bean)
          This method has no work to do as all instances are removed from the pool on getInstance(...) and not returned via poolInstance(...) if they threw a system exception.
 Object getInstance(ThreadContext callContext)
          Removes an instance from the pool and returns it for use by the container in business methods.
 void poolInstance(ThreadContext callContext, Object bean)
          All instances are removed from the pool in getInstance(...).
 void undeploy(CoreDeploymentInfo deploymentInfo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

poolLimit

protected int poolLimit

beanCount

protected int beanCount

strictPooling

protected boolean strictPooling

poolQueue

protected org.apache.openejb.core.stateless.StatelessInstanceManager.PoolQueue poolQueue

toolkit

protected final SafeToolkit toolkit
Constructor Detail

StatelessInstanceManager

public StatelessInstanceManager(TransactionManager transactionManager,
                                SecurityService securityService,
                                int timeout,
                                int poolSize,
                                boolean strictPooling)
Method Detail

getInstance

public Object getInstance(ThreadContext callContext)
                   throws OpenEJBException
Removes an instance from the pool and returns it for use by the container in business methods. If the pool is at it's limit the StrictPooling flag will cause this thread to wait. If StrictPooling is not enabled this method will create a new stateless bean instance performing all required injection and callbacks before returning it in a method ready state.

Parameters:
callContext -
Returns:
Throws:
OpenEJBException

poolInstance

public void poolInstance(ThreadContext callContext,
                         Object bean)
                  throws OpenEJBException
All instances are removed from the pool in getInstance(...). They are only returned by the StatelessContainer via this method under two circumstances. 1. The business method returns normally 2. The business method throws an application exception Instances are not returned to the pool if the business method threw a system exception.

Parameters:
callContext -
bean -
Throws:
OpenEJBException

discardInstance

public void discardInstance(ThreadContext callContext,
                            Object bean)
This method has no work to do as all instances are removed from the pool on getInstance(...) and not returned via poolInstance(...) if they threw a system exception.

Parameters:
callContext -
bean -

deploy

public void deploy(CoreDeploymentInfo deploymentInfo)

undeploy

public void undeploy(CoreDeploymentInfo deploymentInfo)


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.