felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r449768 - in /incubator/felix/trunk/framework/src/main/java/org/apache/felix: framework/ framework/searchpolicy/ moduleloader/
Date Mon, 25 Sep 2006 18:29:28 GMT
Author: rickhall
Date: Mon Sep 25 11:29:27 2006
New Revision: 449768

URL: http://svn.apache.org/viewvc?view=rev&rev=449768
Log:
Modified IContentLoader to include a getResourceFromContent() method to
avoid the class cast exception being reported in FELIX-149.

Modified:
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/SystemBundleContentLoader.java
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IContentLoader.java

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?view=diff&rev=449768&r1=449767&r2=449768
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Mon
Sep 25 11:29:27 2006
@@ -1003,8 +1003,8 @@
         {
             throw new IllegalStateException("The bundle is uninstalled.");
         }
-        return ((ContentLoaderImpl) bundle.getInfo().getCurrentModule()
-            .getContentLoader()).getResourceFromContent(name);
+        return bundle.getInfo().getCurrentModule()
+            .getContentLoader().getResourceFromContent(name);
     }
 
     /**

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java?view=diff&rev=449768&r1=449767&r2=449768
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java
(original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java
Mon Sep 25 11:29:27 2006
@@ -119,9 +119,8 @@
                     if (checkSubstring(m_filePattern, lastElement))
                     {
                         // Convert entry name into an entry URL.
-                        return ((ContentLoaderImpl) m_bundle.getInfo()
-                            .getCurrentModule().getContentLoader())
-                                .getResourceFromContent(entryName);
+                        return m_bundle.getInfo().getCurrentModule()
+                            .getContentLoader().getResourceFromContent(entryName);
                     }
                 }
             }

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/SystemBundleContentLoader.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/SystemBundleContentLoader.java?view=diff&rev=449768&r1=449767&r2=449768
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/SystemBundleContentLoader.java
(original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/SystemBundleContentLoader.java
Mon Sep 25 11:29:27 2006
@@ -91,6 +91,12 @@
         return getClass().getClassLoader().getResource(name);
     }
 
+    public URL getResourceFromContent(String name)
+    {
+        // There is no content for the system bundle, so return null.
+        return null;
+    }
+
     public boolean hasInputStream(String urlPath) throws IOException
     {
         return (getClass().getClassLoader().getResource(urlPath) != null);

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java?view=diff&rev=449768&r1=449767&r2=449768
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java
(original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java
Mon Sep 25 11:29:27 2006
@@ -176,7 +176,8 @@
         return v.elements();
     }
 
-    // TODO: API: Investigate making this an API call.
+    // TODO: API: Investigate how to handle this better, perhaps we need
+    // multiple URL policies, one for content -- one for class path.
     public URL getResourceFromContent(String name)
     {
         URL url = null;

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IContentLoader.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IContentLoader.java?view=diff&rev=449768&r1=449767&r2=449768
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IContentLoader.java
(original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/moduleloader/IContentLoader.java
Mon Sep 25 11:29:27 2006
@@ -37,6 +37,7 @@
 
     public Class getClass(String name);
     public URL getResource(String name);
+    public URL getResourceFromContent(String name);
 
     public boolean hasInputStream(String urlPath)
         throws IOException;



Mime
View raw message