if (rc.skipDuringCreation() && dom.getKey() == null) {
return true; //During creation the coresponding DOM is not fully loaded.
}
Collection<RemoteKeyInfo> remoteKeys = findRemoteKeys(config);
if (remoteKeys != null && !remoteKeys.isEmpty()) {
ServiceLocator habitat = dom.getHabitat();
boolean result = true;
boolean disableGlobalMessage = true;
for (RemoteKeyInfo remoteKeyInfo : remoteKeys) {
if (remoteKeyInfo.method.getParameterTypes().length > 0) {
throw new UnexpectedTypeException(localStrings.getLocalString("referenceValidator.not.getter",
"The RemoteKey annotation must be on a getter method."));
}
try {
Object value = remoteKeyInfo.method.invoke(config);
if (value instanceof String) {
String key = (String) value;
ConfigBeanProxy component = habitat.getService(remoteKeyInfo.annotation.type(), key);
if (component == null) {
result = false;
if (remoteKeyInfo.annotation.message().isEmpty()) {
disableGlobalMessage = false;
} else {