felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r787791 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
Date Tue, 23 Jun 2009 19:05:50 GMT
Author: rickhall
Date: Tue Jun 23 19:05:49 2009
New Revision: 787791

URL: http://svn.apache.org/viewvc?rev=787791&view=rev
Log:
Special case getResource()/getResources()/loadClass() for fragments.
(FELIX-1272)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?rev=787791&r1=787790&r2=787791&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Tue Jun 23 19:05:49
2009
@@ -1248,6 +1248,10 @@
         {
             throw new IllegalStateException("The bundle is uninstalled.");
         }
+        else if (Util.isFragment(bundle.getCurrentModule()))
+        {
+            return null;
+        }
         return bundle.getCurrentModule().getResourceByDelegation(name);
     }
 
@@ -1260,6 +1264,10 @@
         {
             throw new IllegalStateException("The bundle is uninstalled.");
         }
+        else if (Util.isFragment(bundle.getCurrentModule()))
+        {
+            return null;
+        }
         return bundle.getCurrentModule().getResourcesByDelegation(name);
     }
 
@@ -1372,6 +1380,10 @@
         {
             throw new IllegalStateException("Bundle is uninstalled");
         }
+        else if (Util.isFragment(bundle.getCurrentModule()))
+        {
+            throw new ClassNotFoundException("Fragments cannot load classes.");
+        }
         else if (bundle.getState() == Bundle.INSTALLED)
         {
             try



Mime
View raw message