| java.lang.Object org.apache.openejb.core.mdb.MdbInstanceFactory
MdbInstanceFactory | public class MdbInstanceFactory (Code) | | A MdbInstanceFactory creates instances of message driven beans for a single instance. This class differs from other
instance managers in OpenEJB as it doesn't do pooling and it creates instances for only a single EJB deployment.
The MdbContainer assumes that the resouce adapter is pooling message endpoints so a second level of pooling in the
container would be inefficient. This is true of all known resouce adapters in opensource (ActiveMQ), so if this is
a poor assumption for your resource adapter, contact the OpenEJB developers.
This class can optionally limit the number of bean instances and therefore the message endpoints available to the
resource adapter.
|
MdbInstanceFactory | public MdbInstanceFactory(CoreDeploymentInfo deploymentInfo, TransactionManager transactionManager, SecurityService securityService, int instanceLimit)(Code) | | Creates a MdbInstanceFactory for a single specific deployment.
Parameters: deploymentInfo - the deployment for which instances will be created Parameters: transactionManager - the transaction manager for this container system Parameters: securityService - the transaction manager for this container system Parameters: instanceLimit - the maximal number of instances or <= 0 if unlimited |
createInstance | public Object createInstance(boolean ignoreInstanceCount) throws UnavailableException(Code) | | Creates a new mdb instance preforming all necessary lifecycle callbacks
a new message driven bean instance throws: UnavailableException - if the instance limit has been exceeded orif an exception occurs while creating the bean instance Parameters: ignoreInstanceCount - |
freeInstance | public void freeInstance(Instance instance, boolean ignoredInstanceCount)(Code) | | Frees an instance no longer needed by the resource adapter. This method makes all the necessary lifecycle
callbacks and decrements the instance count. This method should not be used to disposed of beans that have
thrown a system exception. Instead the discardInstance method should be called.
Parameters: instance - the bean instance to free Parameters: ignoredInstanceCount - |
getInstanceCount | public synchronized int getInstanceCount()(Code) | | Gets the current number of created instances.
the current number of instances created |
getInstanceLimit | public int getInstanceLimit()(Code) | | Gets the maximal number of instances that can exist at any time.
the maximum number of instances or <= 0 if unlimitied |
recreateInstance | public Object recreateInstance(Object bean) throws UnavailableException(Code) | | Recreates a bean instance that has thrown a system exception. As required by the EJB specification, lifecycle
callbacks are not invoked. To normally free a bean instance call the freeInstance method.
Parameters: bean - the bean instance to discard the new replacement bean instance |
|
|