|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openejb.core.mdb.MdbInstanceFactory
public class MdbInstanceFactory
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.
| Constructor Summary | |
|---|---|
MdbInstanceFactory(BeanContext beanContext,
SecurityService securityService,
int instanceLimit)
Creates a MdbInstanceFactory for a single specific deployment. |
|
| Method Summary | |
|---|---|
Object |
createInstance(boolean ignoreInstanceCount)
Creates a new mdb instance preforming all necessary lifecycle callbacks |
void |
freeInstance(Instance instance,
boolean ignoredInstanceCount)
Frees an instance no longer needed by the resource adapter. |
int |
getInstanceCount()
Gets the current number of created instances. |
int |
getInstanceLimit()
Gets the maximal number of instances that can exist at any time. |
Object |
recreateInstance(Object bean)
Recreates a bean instance that has thrown a system exception. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MdbInstanceFactory(BeanContext beanContext,
SecurityService securityService,
int instanceLimit)
throws OpenEJBException
beanContext - the deployment for which instances will be createdsecurityService - the transaction manager for this container systeminstanceLimit - the maximal number of instances or <= 0 if unlimited
OpenEJBException| Method Detail |
|---|
public int getInstanceLimit()
public int getInstanceCount()
public Object createInstance(boolean ignoreInstanceCount)
throws javax.resource.spi.UnavailableException
ignoreInstanceCount -
javax.resource.spi.UnavailableException - if the instance limit has been exceeded or
if an exception occurs while creating the bean instance
public void freeInstance(Instance instance,
boolean ignoredInstanceCount)
instance - the bean instance to freeignoredInstanceCount -
public Object recreateInstance(Object bean)
throws javax.resource.spi.UnavailableException
bean - the bean instance to discard
javax.resource.spi.UnavailableException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||