descriptor), root.getLocation());
}
}
if (providerDef.isLocal()) {
ComponentConfig config = providerDef.provide(intfDescriptor);
if (config != null) {
ProviderDef remoteProviderDef = root.getProviderDef();
if (remoteProviderDef == null || remoteProviderDef.isLocal()) {
hasLocalDependencies = true;
}
DefDescriptor<ComponentDef> d = config.getDescriptor();
if (d != null) {
descriptor = d;
}
try {
if (descriptor.getDefType() != DefType.COMPONENT) {
throw new AuraRuntimeException(String.format("%s is not a component", descriptor));
}
ComponentDef c = descriptor.getDef();
if (c.isAbstract()) {
throw new AuraRuntimeException(String.format("%s cannot be instantiated directly.",
descriptor));
}
// new component may have its own controllerdef so add that one
ControllerDef cd = c.getControllerDef();
if (cd != null) {
this.valueProviders.put(ValueProviderType.CONTROLLER.getPrefix(), cd);
}
} catch (DefinitionNotFoundException dnfe) {
throw new AuraRuntimeException(String.format("%s did not provide a valid component",
providerDef.getDescriptor()), dnfe);
}
attributeSet.setRootDefDescriptor(descriptor);
Map<String, Object> providedAttributes = config.getAttributes();
if (providedAttributes != null) {
// if there is a remote provider and attributes were
// set, we assume/pray the remote provider does too
hasProvidedAttributes = true;
attributeSet.startTrackingDirtyValues();