You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2013/01/25 14:40:09 UTC
svn commit: r1438508 -
/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
Author: cziegeler
Date: Fri Jan 25 13:40:09 2013
New Revision: 1438508
URL: http://svn.apache.org/viewvc?rev=1438508&view=rev
Log:
FELIX-2929 : Read @Property from interfaces of types annotated with @Component
Modified:
felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java?rev=1438508&r1=1438507&r2=1438508&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java (original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java Fri Jan 25 13:40:09 2013
@@ -385,6 +385,28 @@ public class SCRDescriptorGenerator {
}
} 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);
+ iLog.addError(sde.getMessage(), interfaceName);
+ } catch ( final SCRDescriptorException sde) {
+ this.logger.debug(sde.getSourceLocation() + " : " + sde.getMessage(), sde);
+ iLog.addError(sde.getMessage(), sde.getSourceLocation());
+ } catch (ClassNotFoundException e) {
+ this.logger.debug(e.getMessage(), e);
+ iLog.addError(e.getMessage(), interfaceName);
+ }
+ }
+ }
+
// global properties
this.processGlobalProperties(desc, container.getProperties());