felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guilla...@apache.org
Subject svn commit: r1487443 - /felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ExtensionBundleProcessor.java
Date Wed, 29 May 2013 11:48:39 GMT
Author: guillaume
Date: Wed May 29 11:48:38 2013
New Revision: 1487443

URL: http://svn.apache.org/r1487443
Log:
* Avoid compilation warning
* More explicit error message

Modified:
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ExtensionBundleProcessor.java

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ExtensionBundleProcessor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ExtensionBundleProcessor.java?rev=1487443&r1=1487442&r2=1487443&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ExtensionBundleProcessor.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ExtensionBundleProcessor.java
Wed May 29 11:48:38 2013
@@ -19,6 +19,7 @@
 
 package org.apache.felix.ipojo.extender.internal.processor;
 
+import org.apache.felix.ipojo.IPojoFactory;
 import org.apache.felix.ipojo.extender.internal.BundleProcessor;
 import org.apache.felix.ipojo.extender.internal.builder.ReflectiveFactoryBuilder;
 import org.apache.felix.ipojo.extender.internal.declaration.DefaultExtensionDeclaration;
@@ -125,12 +126,18 @@ public class ExtensionBundleProcessor im
              */
             String[] nameparts = ParseUtils.split(segments[0].trim(), " \t");
             String type = nameparts.length == 1 ? nameparts[0] : nameparts[0] + ":" + nameparts[1];
+            String classname = segments[1];
 
-            Class clazz;
+            Class<? extends IPojoFactory> clazz;
             try {
-                clazz = bundle.loadClass(segments[1]);
+                clazz = bundle.loadClass(classname).asSubclass(IPojoFactory.class);
             } catch (ClassNotFoundException e) {
-                m_logger.log(Logger.ERROR, "Cannot load the extension " + type, e);
+                String message = String.format("Cannot load class '%s' from bundle %s (%s)
for extension '%s'",
+                                               classname,
+                                               bundle.getSymbolicName(),
+                                               bundle.getVersion(),
+                                               type);
+                m_logger.log(Logger.ERROR, message, e);
                 return;
             }
 



Mime
View raw message