felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r374410 - in /incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix: framework/searchpolicy/ moduleloader/
Date Thu, 02 Feb 2006 15:29:47 GMT
Author: rickhall
Date: Thu Feb  2 07:29:42 2006
New Revision: 374410

URL: http://svn.apache.org/viewcvs?rev=374410&view=rev
Log:
Added ISearchPolicy.definePackage() to re-implement some functionality
in the trunk HEAD.

Modified:
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ContentClassLoader.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/IR4SearchPolicy.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/moduleloader/ISearchPolicy.java

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ContentClassLoader.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ContentClassLoader.java?rev=374410&r1=374409&r2=374410&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ContentClassLoader.java
(original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ContentClassLoader.java
Thu Feb  2 07:29:42 2006
@@ -109,10 +109,9 @@
                 {
                     if (getPackage(pkgName) == null)
                     {
-                        Object[] params = null;
-// TODO: FIX PACKAGE POLICY.
-//                        Object[] params =
-//                            m_mgr.getSearchPolicy().definePackage(m_module, pkgName);
+                        Object[] params =
+                            m_contentLoader.getSearchPolicy()
+                                .definePackage(pkgName);
                         if (params != null)
                         {
                             definePackage(

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/IR4SearchPolicy.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/IR4SearchPolicy.java?rev=374410&r1=374409&r2=374410&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/IR4SearchPolicy.java
(original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/IR4SearchPolicy.java
Thu Feb  2 07:29:42 2006
@@ -18,6 +18,17 @@
 
 import org.apache.felix.moduleloader.ISearchPolicy;
 
+/**
+ * <p>
+ * This interface extends the search policy interface with specific
+ * methods related to implementing an R4 search policy. For the most
+ * part, this interface is really implementation specific and should
+ * not be used by any except the R4 search policy implementation or
+ * those that are very sure they know what they are doing. For example,
+ * just blindly calling the various setter methods will likely not
+ * provide the desired results.
+ * </p>
+**/
 public interface IR4SearchPolicy extends ISearchPolicy
 {
     public R4Export[] getExports();

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java?rev=374410&r1=374409&r2=374410&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java
(original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java
Thu Feb  2 07:29:42 2006
@@ -31,6 +31,11 @@
         m_module = module;
     }
 
+    public Object[] definePackage(String name)
+    {
+        return m_policyCore.definePackage(m_module, name);
+    }
+
     public Class findClass(String name)
         throws ClassNotFoundException
     {

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java?rev=374410&r1=374409&r2=374410&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
(original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
Thu Feb  2 07:29:42 2006
@@ -231,6 +231,23 @@
         data.m_resolved = resolved;
     }
 
+    public Object[] definePackage(IModule module, String pkgName)
+    {
+        R4Package pkg = Util.getExportPackage(module, pkgName);
+        if (pkg != null)
+        {
+            return new Object[]  {
+                pkgName, // Spec title.
+                pkg.getVersion().toString(), // Spec version.
+                "", // Spec vendor.
+                "", // Impl title.
+                "", // Impl version.
+                ""  // Impl vendor.
+            };
+        }
+        return null;
+    }
+
     public Class findClass(IModule module, String name)
         throws ClassNotFoundException
     {

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/moduleloader/ISearchPolicy.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/moduleloader/ISearchPolicy.java?rev=374410&r1=374409&r2=374410&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/moduleloader/ISearchPolicy.java
(original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/moduleloader/ISearchPolicy.java
Thu Feb  2 07:29:42 2006
@@ -22,6 +22,7 @@
 
 public interface ISearchPolicy
 {
+    public Object[] definePackage(String name);
     public Class findClass(String name) throws ClassNotFoundException;
     public URL findResource(String name) throws ResourceNotFoundException;
     public String findLibrary(String name);



Mime
View raw message