}
return activationConfigProps;
}
private void processMessageDrivenBeanMetaData(final DeploymentUnit deploymentUnit, final MessageDrivenBeanMetaData mdb) throws DeploymentUnitProcessingException {
final EjbJarDescription ejbJarDescription = getEjbJarDescription(deploymentUnit);
final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
final String beanName = mdb.getName();
// the important bit is to skip already processed EJBs via annotations
if (ejbJarDescription.hasComponent(beanName)) {
final ComponentDescription description = eeModuleDescription.getComponentByName(beanName);
if (description instanceof MessageDrivenComponentDescription) {
((MessageDrivenComponentDescription) description).setDescriptorData(mdb);
} else {
throw new DeploymentUnitProcessingException("MDB with name " + beanName + " referenced in ejb-jar.xml could not be created, as existing non MDB component with same name already exists: " + description);
}
return;
}
final String beanClassName = mdb.getEjbClass();
String messageListenerInterface = mdb.getMessagingType();
if (messageListenerInterface == null || messageListenerInterface.trim().isEmpty()) {
// TODO: This isn't really correct to default to MessageListener
messageListenerInterface = MessageListener.class.getName();
}
final Properties activationConfigProps = getActivationConfigProperties(mdb.getActivationConfig());
final String defaultResourceAdapterName = this.getDefaultResourceAdapterName(deploymentUnit.getServiceRegistry());
final MessageDrivenComponentDescription mdbComponentDescription = new MessageDrivenComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnit.getServiceName(), messageListenerInterface, activationConfigProps, defaultResourceAdapterName);
// add it to the ejb jar description
ejbJarDescription.getEEModuleDescription().addComponent(mdbComponentDescription);
mdbComponentDescription.setDescriptorData(mdb);
mdbComponentDescription.setDeploymentDescriptorEnvironment(new DeploymentDescriptorEnvironment("java:comp/env/", mdb));
}