org.apache.openejb.core.stateless
Class StatelessInstanceManager

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

public class StatelessInstanceManager
extends java.lang.Object


Field Summary
protected  Duration accessTimeout
           
protected  int beanCount
           
protected  Duration closeTimeout
           
protected  SafeToolkit toolkit
           
 
Constructor Summary
StatelessInstanceManager(SecurityService securityService, Duration accessTimeout, Duration closeTimeout, Pool.Builder poolBuilder, int callbackThreads)
           
 
Method Summary
 void deploy(CoreDeploymentInfo deploymentInfo)
           
 void discardInstance(ThreadContext callContext, java.lang.Object bean)
          This method is called to release the semaphore in case of the business method throwing a system exception
 java.lang.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, java.lang.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

accessTimeout

protected Duration accessTimeout

closeTimeout

protected Duration closeTimeout

beanCount

protected int beanCount

toolkit

protected final SafeToolkit toolkit
Constructor Detail

StatelessInstanceManager

public StatelessInstanceManager(SecurityService securityService,
                                Duration accessTimeout,
                                Duration closeTimeout,
                                Pool.Builder poolBuilder,
                                int callbackThreads)
Method Detail

getInstance

public java.lang.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,
                         java.lang.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,
                            java.lang.Object bean)
                     throws SystemException
This method is called to release the semaphore in case of the business method throwing a system exception

Parameters:
callContext -
bean -
Throws:
SystemException

deploy

public void deploy(CoreDeploymentInfo deploymentInfo)
            throws OpenEJBException
Throws:
OpenEJBException

undeploy

public void undeploy(CoreDeploymentInfo deploymentInfo)


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