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, ReferenceType.RESOURCE_ENV, module.getJndiContext(), resourceEnvRef.getInjectionTarget(), sharedContext);
}
}
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
for (Map.Entry<String, MessageDestinationRef> entry : specDD.getMessageDestinationRefMap().entrySet()) {
String name = entry.getKey();
if (lookupJndiContextMap(module, name) != null) {
// some other builder handled this entry already
continue;
}
MessageDestinationRef messageDestinationRef = entry.getValue();
String linkName = getStringValue(messageDestinationRef.getMessageDestinationLink());
//TODO figure out something better to do here!
if (linkName == null) {
linkName = name;
}
String type = getStringValue(messageDestinationRef.getMessageDestinationType());
type = inferAndCheckType(module, bundle, messageDestinationRef.getInjectionTarget(), name, type);
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);