resourceEnvRef.setMappedName(mappedName);
}
}
private void addMethodDestinationRef(AnnotatedApp annotatedApp, String resourceName, String resourceType, Method method, Field field, Resource annotation) {
MessageDestinationRefType messageDestinationRef = annotatedApp.addNewMessageDestinationRef();
//------------------------------------------------------------------------------
// <message-destination-ref> required elements:
//------------------------------------------------------------------------------
// message-destination-ref-name
JndiNameType messageDestinationRefName = messageDestinationRef.addNewMessageDestinationRefName();
messageDestinationRefName.setStringValue(resourceName);
messageDestinationRef.setMessageDestinationRefName(messageDestinationRefName);
if (!resourceType.equals("")) {
// message-destination-ref-type
MessageDestinationTypeType msgDestType = messageDestinationRef.addNewMessageDestinationType();
msgDestType.setStringValue(resourceType);
messageDestinationRef.setMessageDestinationType(msgDestType);
}
if (method != null || field != null) {
// injectionTarget
InjectionTargetType injectionTarget = messageDestinationRef.addNewInjectionTarget();
configureInjectionTarget(injectionTarget, method, field);
}
//------------------------------------------------------------------------------
// <message-destination-ref> optional elements:
//------------------------------------------------------------------------------
// description
String descriptionAnnotation = annotation.description();
if (!descriptionAnnotation.equals("")) {
DescriptionType description = messageDestinationRef.addNewDescription();
description.setStringValue(descriptionAnnotation);
}
// mappedName
String mappdedNameAnnotation = annotation.mappedName();
if (!mappdedNameAnnotation.equals("")) {
XsdStringType mappedName = messageDestinationRef.addNewMappedName();
mappedName.setStringValue(mappdedNameAnnotation);
messageDestinationRef.setMappedName(mappedName);
}
}