iLog.addWarning(" Component " + componentDesc.getName() + " has set a description. However metatype is set to false. This description is ignored.",
desc.getSource());
}
}
ClassDescription current = desc;
boolean inherit;
do {
final ComponentDescription cd = current.getDescription(ComponentDescription.class);
inherit = (cd == null ? true : cd.isInherit());
if ( cd != null ) {
if ( current != desc ) {
iLog.addWarning(" Component " + componentDesc.getName() + " is using the " +
"deprecated inheritance feature and inherits from " + current.getDescribedClass().getName() +
". This feature will be removed in future versions.",
desc.getSource());
}
// handle enabled and immediate
if ( componentDesc.getEnabled() == null ) {
componentDesc.setEnabled(cd.getEnabled());
}
if ( componentDesc.getImmediate() == null ) {
componentDesc.setImmediate(cd.getImmediate());
}
// lifecycle methods
if ( componentDesc.getActivate() == null && cd.getActivate() != null ) {
componentDesc.setActivate(cd.getActivate());
}
if ( componentDesc.getDeactivate() == null && cd.getDeactivate() != null ) {
componentDesc.setDeactivate(cd.getDeactivate());
}
if ( componentDesc.getModified() == null && cd.getModified() != null ) {
componentDesc.setModified(cd.getModified());
}
if ( componentDesc.getActivate() != null || componentDesc.getDeactivate() != null || componentDesc.getModified() != null ) {
// spec version must be at least 1.1
componentDesc.setSpecVersion(SpecVersion.VERSION_1_1);
}
if ( componentDesc.getConfigurationPolicy() != ComponentConfigurationPolicy.OPTIONAL ) {
// policy requires 1.1
componentDesc.setSpecVersion(SpecVersion.VERSION_1_1);
}
}
// services, properties, references
this.processServices(current, container);
this.processProperties(current, container, ocd);
this.processReferences(current, container);
// go up in the class hierarchy
if ( !inherit || current.getDescribedClass().getSuperclass() == null ) {
current = null;
} else {
try {
current = this.scanner.getDescription(current.getDescribedClass().getSuperclass());
} catch ( final SCRDescriptorFailureException sde) {
this.logger.debug(sde.getMessage(), sde);
iLog.addError(sde.getMessage(), current.getSource());
} catch ( final SCRDescriptorException sde) {
this.logger.debug(sde.getSourceLocation() + " : " + sde.getMessage(), sde);
iLog.addError(sde.getMessage(), sde.getSourceLocation());
}
}
} while ( current != null);
// check service interfaces for properties
if ( container.getServiceDescription() != null ) {
for(final String interfaceName : container.getServiceDescription().getInterfaces()) {
try {
final Class<?> interfaceClass = project.getClassLoader().loadClass(interfaceName);
final ClassDescription interfaceDesc = this.scanner.getDescription(interfaceClass);
if ( interfaceDesc != null ) {
this.processProperties(interfaceDesc, container, ocd);
}
} catch ( final SCRDescriptorFailureException sde) {
this.logger.debug(sde.getMessage(), sde);