}
annotatedApp.getResourceEnvRef().add(resourceEnvRef);
}
private void addMethodDestinationRef(JndiConsumer annotatedApp, String resourceName, String resourceType, Method method, Field field, Resource annotation) {
MessageDestinationRef messageDestinationRef = new MessageDestinationRef();
//------------------------------------------------------------------------------
// <message-destination-ref> required elements:
//------------------------------------------------------------------------------
// message-destination-ref-name
messageDestinationRef.setMessageDestinationRefName(resourceName);
if (!resourceType.isEmpty()) {
// message-destination-ref-type
messageDestinationRef.setMessageDestinationType(resourceType);
}
if (method != null || field != null) {
// injectionTarget
messageDestinationRef.getInjectionTarget().add(configureInjectionTarget(method, field));
}
//------------------------------------------------------------------------------
// <message-destination-ref> optional elements:
//------------------------------------------------------------------------------
// description
String descriptionAnnotation = annotation.description();
if (!descriptionAnnotation.isEmpty()) {
messageDestinationRef.setDescriptions(new Text[]{new Text(null, descriptionAnnotation)});
}
// mappedName
String mappdedNameAnnotation = annotation.mappedName();
if (!mappdedNameAnnotation.isEmpty()) {
messageDestinationRef.setMappedName(mappdedNameAnnotation);
}
// lookup
String lookup = annotation.lookup();
if (!lookup.isEmpty()) {
messageDestinationRef.setLookupName(lookup);
}
annotatedApp.getMessageDestinationRef().add(messageDestinationRef);
}