org.openmdx.kernel.application.container.spi.ejb
Class BeanInstanceFactory

java.lang.Object
  extended by org.openmdx.kernel.application.container.spi.ejb.BeanInstanceFactory
All Implemented Interfaces:
ContextSwitcher, PoolableObjectFactory

public class BeanInstanceFactory
extends Object
implements PoolableObjectFactory, ContextSwitcher

Bean Instance Factory


Constructor Summary
BeanInstanceFactory(ClassLoader beanClassLoader, Deployment.SessionBean bean, SessionContext sessionContext)
           
 
Method Summary
 void activateObject(Object obj)
          Reinitialize an instance to be returned by the pool.
 void destroyObject(Object obj)
          Destroys an instance no longer needed by the pool.
 Class getInstanceClass()
           
 Object makeObject()
          Creates an instance that can be returned by the pool.
 void passivateObject(Object obj)
          Uninitialize an instance to be returned to the pool.
 Object setBeanContext()
          Replace the caller's context by the EJB's context.
 void setCallerContext(Object callerContext)
          Replace the EJB's context by the caller's context.
 boolean validateObject(Object obj)
          Ensures that the instance is safe to be returned by the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanInstanceFactory

public BeanInstanceFactory(ClassLoader beanClassLoader,
                           Deployment.SessionBean bean,
                           SessionContext sessionContext)
                    throws ClassNotFoundException,
                           SecurityException,
                           NoSuchMethodException
Throws:
ClassNotFoundException
SecurityException
NoSuchMethodException
Method Detail

getInstanceClass

public Class getInstanceClass()
Returns:
Returns the instanceClass.

makeObject

public Object makeObject()
                  throws Exception
Description copied from interface: PoolableObjectFactory
Creates an instance that can be returned by the pool.

Specified by:
makeObject in interface PoolableObjectFactory
Returns:
an instance that can be returned by the pool.
Throws:
Exception

destroyObject

public void destroyObject(Object obj)
                   throws Exception
Description copied from interface: PoolableObjectFactory
Destroys an instance no longer needed by the pool.

Specified by:
destroyObject in interface PoolableObjectFactory
Parameters:
obj - the instance to be destroyed
Throws:
Exception

validateObject

public boolean validateObject(Object obj)
Description copied from interface: PoolableObjectFactory
Ensures that the instance is safe to be returned by the pool. Returns false if this object should be destroyed.

Specified by:
validateObject in interface PoolableObjectFactory
Parameters:
obj - the instance to be validated
Returns:
false if this obj is not valid and should be dropped from the pool, true otherwise.

activateObject

public void activateObject(Object obj)
                    throws Exception
Description copied from interface: PoolableObjectFactory
Reinitialize an instance to be returned by the pool.

Specified by:
activateObject in interface PoolableObjectFactory
Parameters:
obj - the instance to be activated
Throws:
Exception

passivateObject

public void passivateObject(Object obj)
                     throws Exception
Description copied from interface: PoolableObjectFactory
Uninitialize an instance to be returned to the pool.

Specified by:
passivateObject in interface PoolableObjectFactory
Parameters:
obj - the instance to be passivated
Throws:
Exception

setBeanContext

public Object setBeanContext()
Description copied from interface: ContextSwitcher
Replace the caller's context by the EJB's context.

Specified by:
setBeanContext in interface ContextSwitcher
Returns:
the caller's context

setCallerContext

public void setCallerContext(Object callerContext)
Description copied from interface: ContextSwitcher
Replace the EJB's context by the caller's context.

Specified by:
setCallerContext in interface ContextSwitcher
Parameters:
callerContext - the caller's context


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.