{
MessageDriven annotation = finder.getAnnotation(beanClass, MessageDriven.class);
if(annotation == null)
return null;
JBossMessageDrivenBeanMetaData metaData = new JBossMessageDrivenBeanMetaData();
metaData.setEjbClass(beanClass.getName());
if(annotation.name().length() > 0)
metaData.setEjbName(annotation.name());
else
metaData.setEjbName(beanClass.getSimpleName());
if(annotation.description().length() > 0)
{
DescriptionGroupMetaData dg = ProcessorUtils.getDescriptionGroup(annotation.description());
metaData.setDescriptionGroup(dg);
}
if(annotation.mappedName().length() > 0)
metaData.setMappedName(annotation.mappedName());
if(annotation.messageListenerInterface() != Object.class)
metaData.setMessagingType(annotation.messageListenerInterface().getName());
ActivationConfigProperty[] props = annotation.activationConfig();
ActivationConfigMetaData config = new ActivationConfigMetaData();
ActivationConfigPropertiesMetaData configProps = new ActivationConfigPropertiesMetaData();
config.setActivationConfigProperties(configProps);
for(ActivationConfigProperty prop : props)
{
ActivationConfigPropertyMetaData acp = new ActivationConfigPropertyMetaData();
acp.setActivationConfigPropertyName(prop.propertyName());
acp.setValue(prop.propertyValue());
configProps.add(acp);
}
metaData.setActivationConfig(config);
return metaData;
}