{
ProducersImpl producersAnnotation = new ProducersImpl();
for(ProducerMetaData producer : consumer.getProducers())
{
ProducerImpl annotation = new ProducerImpl(di.getClassLoader()
.loadClass(producer.getClassName()));
if (producer.getConnectionFactory() != null)
annotation.setConnectionFactory(producer.getConnectionFactory());
producersAnnotation.addProducer(annotation);
}
for(ProducerMetaData producer : consumer.getLocalProducers())
{
ProducerImpl annotation = new ProducerImpl(di.getClassLoader()
.loadClass(producer.getClassName()));
if (producer.getConnectionFactory() != null)
annotation.setConnectionFactory(producer.getConnectionFactory());
producersAnnotation.addProducer(annotation);
}
addClassAnnotation(container, Producers.class, producersAnnotation);
}
MethodAttributesMetaData currentMessage = consumer
.getCurrentMessage();
if (currentMessage != null)
{
CurrentMessageImpl annotation = new CurrentMessageImpl();
for(MethodAttributeMetaData method : currentMessage)
{
addAnnotations(CurrentMessage.class, annotation, container, method);
}
}
List<MessagePropertiesMetaData> propertiesList = consumer.getMessageProperties();
if (propertiesList != null)
{
for(MessagePropertiesMetaData properties : propertiesList)
{
MessagePropertiesImpl annotation = new MessagePropertiesImpl();
String delivery = properties.getDelivery();
if (delivery != null && delivery.equals("Persistent"))
annotation.setDelivery(DeliveryMode.PERSISTENT);
else
annotation.setDelivery(DeliveryMode.NON_PERSISTENT);
Integer priority = properties.getPriority();
if (priority != null)
annotation.setDelivery(DeliveryMode.PERSISTENT);
String interfac = properties.getClassName();
if (interfac != null)
{
Class<?> clazz = di.getClassLoader().loadClass(interfac);
annotation.setInterface(clazz);
}
MethodAttributeMetaData method = properties.getMethod();
addAnnotations(MessageProperties.class, annotation, container, method);
}