String lookupName = getStringValue(resourceEnvRef.getLookupName());
if (lookupName != null) {
if (lookupName.equals(getJndiName(name))) {
throw new DeploymentException("resource-env-ref lookup name refers to itself");
}
value = new JndiReference(lookupName);
}
}
if (value == null) {
value = buildResourceReference(module, name, type, gerResourceEnvRef);
}
if (value == null) {
unresolvedRefs.add(name);
} else {
put(name, value, getJndiContextMap(componentContext));
}
}
if (unresolvedRefs.size() > 0) {
log.warn("Failed to build reference to resource env reference " + unresolvedRefs + " defined in plan file. The corresponding entry in Geronimo deployment descriptor is missing.");
}
//message-destination-refs
List<MessageDestinationRefType> messageDestinationRefsUntyped = convert(specDD.selectChildren(messageDestinationRefQNameSet), JEE_CONVERTER, MessageDestinationRefType.class, MessageDestinationRefType.type);
for (MessageDestinationRefType messageDestinationRef : messageDestinationRefsUntyped) {
String name = getStringValue(messageDestinationRef.getMessageDestinationRefName());
if (lookupJndiContextMap(componentContext, name) != null) {
// some other builder handled this entry already
continue;
}
addInjections(name, messageDestinationRef.getInjectionTargetArray(), componentContext);
String linkName = getStringValue(messageDestinationRef.getMessageDestinationLink());
//TODO figure out something better to do here!
if (linkName == null) {
linkName = name;
}
String type = getStringValue(messageDestinationRef.getMessageDestinationType());
if (type == null) {
//must have an injection target to determine type EE5.8.1.3
InjectionTargetType[] targets = messageDestinationRef.getInjectionTargetArray();
if (targets.length == 0) {
throw new DeploymentException("No type for message-destination-ref can be determined from explicit specification or injection target: " + messageDestinationRef);
}
type = getStringValue(targets[0].getInjectionTargetClass());
if (type == null) {
throw new DeploymentException("No type for message-destination-ref in injection target: " + targets[0]);
}
}
GerMessageDestinationType destination = getMessageDestination(linkName, messageDestinations);
Object value = null;
if (destination == null) {
String lookupName = getStringValue(messageDestinationRef.getLookupName());
if (lookupName != null) {
if (lookupName.equals(getJndiName(name))) {
throw new DeploymentException("message-destination-ref lookup name refers to itself");
}
value = new JndiReference(lookupName);
}
}
if (value == null) {
value = buildMessageReference(module, linkName, type, destination);