You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by gn...@apache.org on 2009/06/02 01:51:46 UTC

svn commit: r780889 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java

Author: gnodet
Date: Mon Jun  1 23:51:46 2009
New Revision: 780889

URL: http://svn.apache.org/viewvc?rev=780889&view=rev
Log:
When the class is given using the runtimeClass on the metadata, we need to use the types using this class's classLoader instead of the blueprint bundle

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java?rev=780889&r1=780888&r2=780889&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java Mon Jun  1 23:51:46 2009
@@ -159,6 +159,19 @@
         }
     }
 
+    @Override
+    protected Class loadClass(String className) {
+        if (type instanceof Class) {
+            try {
+                return ((Class) type).getClassLoader().loadClass(className);
+            } catch (ClassNotFoundException e) {
+                throw new ComponentDefinitionException("Unable to load class " + className + " from recipe " + this, e);
+            }
+        } else {
+            return super.loadClass(className);
+        }
+    }
+
     private Object getInstance() throws ComponentDefinitionException {
         Object instance;