protected MDB getMDB(int ejbIndex, JBossMessageDrivenBeanMetaData beanMetaData) throws Exception
{
String domainName = getMDBDomainName(ejbIndex);
String containerName = getAspectDomain(ejbIndex, domainName);
DomainDefinition domain = AspectManager.instance().getContainer(containerName);
if (domain == null)
{
throw new RuntimeException("Could not get container for bean class " + beanMetaData.getEjbClass()
+ " with bean name " + beanMetaData.getEjbName() + " because no container configured with name '"
+ containerName + "'");
}
MDB container = new MDB(ejbNames.get(ejbIndex), (Domain) domain.getManager(), di.getClassLoader(), className,
ctxProperties, deployment, beanMetaData);
Method method = getMethod(container.getBeanClass(), "ejbCreate");
if(method != null)
{
addAnnotation(new PostConstructImpl(), container, method);
}
return container;
}