public class MdbInstanceFactory extends Object
| Constructor and Description |
|---|
MdbInstanceFactory(BeanContext beanContext,
SecurityService securityService,
int instanceLimit)
Creates a MdbInstanceFactory for a single specific deployment.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 unlimitedOpenEJBExceptionpublic 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 instancepublic 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 discardjavax.resource.spi.UnavailableExceptionCopyright © 1999–2014 The Apache Software Foundation. All rights reserved.