public class MdbInstanceFactory
extends java.lang.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 |
---|---|
java.lang.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.
|
java.lang.Object |
recreateInstance(java.lang.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 unlimitedOpenEJBException
public int getInstanceLimit()
public int getInstanceCount()
public java.lang.Object createInstance(boolean ignoreInstanceCount) throws UnavailableException
ignoreInstanceCount
- 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 java.lang.Object recreateInstance(java.lang.Object bean) throws UnavailableException
bean
- the bean instance to discardUnavailableException