You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2006/02/02 11:32:51 UTC

svn commit: r374343 [1/2] - /incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/

Author: rickhall
Date: Thu Feb  2 02:32:41 2006
New Revision: 374343

URL: http://svn.apache.org/viewcvs?rev=374343&view=rev
Log:
Modifications to the R4 search policy implementation to accomodate the
new abstractions in the module loader layer.

Added:
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/IR4SearchPolicy.java   (with props)
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java   (with props)
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java   (with props)
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/ContentLoaderImpl.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Export.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Import.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4LibraryHeader.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Package.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Wire.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ResolveListener.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/URLPolicyImpl.java
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/VersionRange.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=374343&r1=374342&r2=374343&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 02:32:41 2006
@@ -1,3 +1,19 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 package org.apache.felix.framework.searchpolicy;
 
 import java.net.URL;
@@ -22,7 +38,7 @@
         return m_contentLoader;
     }
 
-    public Class loadClassLocal(String name)
+    public Class loadClassFromModule(String name)
         throws ClassNotFoundException
     {
         // Ask the search policy for the clas before consulting the module.
@@ -42,9 +58,11 @@
     {
         // Make sure the class was not already loaded.
         Class clazz = findLoadedClass(name);
-
-        // Ask the search policy for the clas before consulting the module.
-        clazz = m_contentLoader.getModuleCallback().findClass(name);
+        if (clazz == null)
+        {
+            // Ask the search policy for the class.
+            clazz = m_contentLoader.getSearchPolicy().findClass(name);
+        }
 
         // If still not found, then throw an exception.
         if (clazz == null)
@@ -145,7 +163,7 @@
         return null;
     }
 
-    public URL getResourceLocal(String name)
+    public URL getResourceFromModule(String name)
     {
         try
         {
@@ -163,7 +181,7 @@
         // Ask the search policy for the class before consulting the module.
         try
         {
-            return m_contentLoader.getModuleCallback().findResource(name);
+            return m_contentLoader.getSearchPolicy().findResource(name);
         }
         catch (ResourceNotFoundException ex)
         {
@@ -188,7 +206,7 @@
         {
             if (m_contentLoader.getClassPath()[i].hasEntry(name))
             {
-                url = m_contentLoader.getModuleCallback().createURL(i + "/" + name);
+                url = m_contentLoader.getURLPolicy().createURL(i + "/" + name);
             }
         }
 
@@ -197,6 +215,6 @@
 
     protected String findLibrary(String name)
     {
-        return m_contentLoader.findLibrary(name);
+        return m_contentLoader.getSearchPolicy().findLibrary(name);
     }
 }

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java?rev=374343&r1=374342&r2=374343&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java (original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java Thu Feb  2 02:32:41 2006
@@ -1,3 +1,19 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 package org.apache.felix.framework.searchpolicy;
 
 import java.io.IOException;
@@ -11,20 +27,23 @@
 {
     private Logger m_logger = null;
     private IContent m_content = null;
-    private IContent[] m_classPath = null;
-    private IModuleCallback m_callback = null;
+    private IContent[] m_contentPath = null;
+    private ISearchPolicy m_searchPolicy = null;
+    private IURLPolicy m_urlPolicy = null;
     private ContentClassLoader m_classLoader = null;
 
-    public ContentLoaderImpl(Logger logger, IContent content, IContent[] classPath)
+    public ContentLoaderImpl(Logger logger, IContent content, IContent[] contentPath)
     {
         m_logger = logger;
         m_content = content;
+// TODO: FIX - SINCE WE CLOSE IN FELIX.JAVA, MAYBE WE SHOULD OPEN THERE TOO.
         m_content.open();
-        m_classPath = (classPath == null) ? new IContent[0] : classPath;
-        for (int i = 0; i < m_classPath.length; i++)
+        m_contentPath = (contentPath == null) ? new IContent[0] : contentPath;
+        for (int i = 0; i < m_contentPath.length; i++)
         {
+// TODO: FIX - SINCE WE CLOSE IN FELIX.JAVA, MAYBE WE SHOULD OPEN THERE TOO.
             // Open all class path contents.
-            m_classPath[i].open();
+            m_contentPath[i].open();
         }
     }
 
@@ -40,17 +59,27 @@
 
     public IContent[] getClassPath()
     {
-        return m_classPath;
+        return m_contentPath;
     }
 
-    public void setModuleCallback(IModuleCallback callback)
+    public void setSearchPolicy(ISearchPolicy searchPolicy)
     {
-        m_callback = callback;
+        m_searchPolicy = searchPolicy;
     }
 
-    public IModuleCallback getModuleCallback()
+    public ISearchPolicy getSearchPolicy()
     {
-        return m_callback;
+        return m_searchPolicy;
+    }
+
+    public void setURLPolicy(IURLPolicy urlPolicy)
+    {
+        m_urlPolicy = urlPolicy;
+    }
+
+    public IURLPolicy getURLPolicy()
+    {
+        return m_urlPolicy;
     }
 
     public Class getClass(String name)
@@ -62,7 +91,7 @@
 
         try
         {
-            return m_classLoader.loadClassLocal(name);
+            return m_classLoader.loadClassFromModule(name);
         }
         catch (ClassNotFoundException ex)
         {
@@ -77,7 +106,7 @@
             m_classLoader = new ContentClassLoader(this);
         }
 
-        return m_classLoader.getResourceLocal(name);
+        return m_classLoader.getResourceFromModule(name);
     }
 
     public InputStream getResourceAsStream(String name)
@@ -91,11 +120,11 @@
         // <class-path-index> / <relative-resource-path>
         int idx = Integer.parseInt(name.substring(0, name.indexOf('/')));
         name = name.substring(name.indexOf('/') + 1);
-        return m_classPath[idx].getEntryAsStream(name);
+        return m_contentPath[idx].getEntryAsStream(name);
     }
 
-    public String findLibrary(String name)
+    public String toString()
     {
-        return m_callback.findLibrary(name);
+        return m_searchPolicy.toString();
     }
 }

Added: 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=374343&view=auto
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/IR4SearchPolicy.java (added)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/IR4SearchPolicy.java Thu Feb  2 02:32:41 2006
@@ -0,0 +1,44 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.felix.framework.searchpolicy;
+
+import org.apache.felix.moduleloader.ISearchPolicy;
+
+public interface IR4SearchPolicy extends ISearchPolicy
+{
+    public R4Export[] getExports();
+    public void setExports(R4Export[] exports);
+
+    public R4Import[] getImports();
+    public void setImports(R4Import[] imports);
+
+    public R4Import[] getDynamicImports();
+    public void setDynamicImports(R4Import[] imports);
+
+    public R4Library[] getLibraries();
+    public void setLibraries(R4Library[] libraries);
+
+    public R4Wire[] getWires();
+    public void setWires(R4Wire[] wires);
+
+    public boolean isResolved();
+    public void setResolved(boolean resolved);
+    public void resolve() throws ResolveException;
+
+    public void addResolverListener(ResolveListener l);
+    public void removeResolverListener(ResolveListener l);
+}
\ No newline at end of file

Propchange: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/IR4SearchPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Export.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Export.java?rev=374343&r1=374342&r2=374343&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Export.java (original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Export.java Thu Feb  2 02:32:41 2006
@@ -1,3 +1,19 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 package org.apache.felix.framework.searchpolicy;
 
 import java.util.*;
@@ -89,7 +105,7 @@
         }
 
         // Find and parse version attribute, if present.
-        String versionInterval = "0.0.0";
+        String rangeStr = "0.0.0";
         for (int i = 0; i < m_attrs.length; i++)
         {
             if (m_attrs[i].getName().equals(FelixConstants.VERSION_ATTRIBUTE) ||
@@ -99,12 +115,12 @@
                 m_attrs[i] = new R4Attribute(
                     FelixConstants.VERSION_ATTRIBUTE, m_attrs[i].getValue(),
                     m_attrs[i].isMandatory());
-                versionInterval = m_attrs[i].getValue();
+                rangeStr = m_attrs[i].getValue();
                 break;
             }
         }
         
-        VersionRange range = parseVersionInterval(versionInterval);
+        VersionRange range = VersionRange.parse(rangeStr);
         // For now, ignore if we have a version range.
         m_version = range.getLow();
     }
@@ -143,7 +159,6 @@
         {
             excluded = checkSubstring(m_excludeFilter[i], className);
         }
-System.out.println("INCLUDED " + (included && !excluded));
         return included && !excluded;
     }
 

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Import.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Import.java?rev=374343&r1=374342&r2=374343&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Import.java (original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Import.java Thu Feb  2 02:32:41 2006
@@ -1,3 +1,19 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 package org.apache.felix.framework.searchpolicy;
 
 import org.apache.felix.framework.util.FelixConstants;
@@ -27,7 +43,7 @@
         }
 
         // Find and parse version attribute, if present.
-        String versionInterval = "0.0.0";
+        String rangeStr = "0.0.0";
         for (int i = 0; i < m_attrs.length; i++)
         {
             if (m_attrs[i].getName().equals(FelixConstants.VERSION_ATTRIBUTE) ||
@@ -37,12 +53,12 @@
                 m_attrs[i] = new R4Attribute(
                     FelixConstants.VERSION_ATTRIBUTE, m_attrs[i].getValue(),
                     m_attrs[i].isMandatory());
-                versionInterval = m_attrs[i].getValue();
+                rangeStr = m_attrs[i].getValue();
                 break;
             }
         }
         
-        m_versionRange = parseVersionInterval(versionInterval);
+        m_versionRange = VersionRange.parse(rangeStr);
         m_version = m_versionRange.getLow();
     }
 

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java?rev=374343&r1=374342&r2=374343&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java (original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java Thu Feb  2 02:32:41 2006
@@ -1,5 +1,5 @@
 /*
- *   Copyright 2005 The Apache Software Foundation
+ *   Copyright 2006 The Apache Software Foundation
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -29,11 +29,11 @@
     private int m_revision = -1;
     private String m_os = null;
     private String m_processor = null;
-    private R4LibraryHeader[] m_headers = null;
+    private R4LibraryHeader m_header = null;
 
     public R4Library(
         Logger logger, BundleCache cache, long bundleId, int revision,
-        String os, String processor, R4LibraryHeader[] headers)
+        String os, String processor, R4LibraryHeader header)
     {
         m_logger = logger;
         m_cache = cache;
@@ -41,36 +41,25 @@
         m_revision = revision;
         m_os = normalizePropertyValue(Constants.FRAMEWORK_OS_NAME, os);
         m_processor = normalizePropertyValue(Constants.FRAMEWORK_PROCESSOR, processor);
-        m_headers = headers;
+        m_header = header;
     }
 
     public String getPath(String name)
     {
-        if (m_headers != null)
+        if (m_header != null)
         {
             String libname = System.mapLibraryName(name);
 
-            // Check to see if we have a matching library.
-            // TODO: This "matching" algorithm does not fully
-            // match the spec and should be improved.
-            R4LibraryHeader library = null;
-            for (int i = 0; (library == null) && (i < m_headers.length); i++)
-            {
-                boolean osOkay = checkOS(m_headers[i].getOSNames());
-                boolean procOkay = checkProcessor(m_headers[i].getProcessors());
-                if (m_headers[i].getName().endsWith(libname) && osOkay && procOkay)
-                {
-                    library = m_headers[i];
-                }
-            }
-
-            if (library != null)
+            // Check to see if the library matches.
+            boolean osOkay = checkOS(m_header.getOSNames());
+            boolean procOkay = checkProcessor(m_header.getProcessors());
+            if (m_header.getName().endsWith(libname) && osOkay && procOkay)
             {
                 try {
                     return m_cache.getArchive(m_bundleId)
-                        .findLibrary(m_revision, library.getName());
+                        .findLibrary(m_revision, m_header.getName());
                 } catch (Exception ex) {
-                    m_logger.log(Logger.LOG_ERROR, "OSGiLibrarySource: Error finding library.", ex);
+                    m_logger.log(Logger.LOG_ERROR, "R4Library: Error finding library.", ex);
                 }
             }
         }

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4LibraryHeader.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4LibraryHeader.java?rev=374343&r1=374342&r2=374343&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4LibraryHeader.java (original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4LibraryHeader.java Thu Feb  2 02:32:41 2006
@@ -1,5 +1,5 @@
 /*
- *   Copyright 2005 The Apache Software Foundation
+ *   Copyright 2006 The Apache Software Foundation
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Package.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Package.java?rev=374343&r1=374342&r2=374343&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Package.java (original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4Package.java Thu Feb  2 02:32:41 2006
@@ -1,3 +1,19 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
 package org.apache.felix.framework.searchpolicy;
 
 import java.util.ArrayList;
@@ -178,23 +194,5 @@
         R4Package[] pkgs = (R4Package[])
             completeList.toArray(new R4Package[completeList.size()]);
         return pkgs;
-    }
-
-    public static VersionRange parseVersionInterval(String interval)
-    {
-        // Check if the version is an interval.
-        if (interval.indexOf(',') >= 0)
-        {
-            String s = interval.substring(1, interval.length() - 1);
-            String vlo = s.substring(0, s.indexOf(','));
-            String vhi = s.substring(s.indexOf(',') + 1, s.length());
-            return new VersionRange (
-                new Version(vlo), (interval.charAt(0) == '['),
-                new Version(vhi), (interval.charAt(interval.length() - 1) == ']'));
-        }
-        else
-        {
-            return new VersionRange(new Version(interval), true, null, false);
-        }
     }
 }

Added: 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=374343&view=auto
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java (added)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java Thu Feb  2 02:32:41 2006
@@ -0,0 +1,130 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.felix.framework.searchpolicy;
+
+import java.net.URL;
+
+import org.apache.felix.moduleloader.*;
+
+public class R4SearchPolicy implements IR4SearchPolicy
+{
+    private R4SearchPolicyCore m_policyCore = null;
+    private IModule m_module = null;
+
+    public R4SearchPolicy(R4SearchPolicyCore policyCore, IModule module)
+    {
+        m_policyCore = policyCore;
+        m_module = module;
+    }
+
+    public Class findClass(String name)
+        throws ClassNotFoundException
+    {
+        return m_policyCore.findClass(m_module, name);
+    }
+
+    public URL findResource(String name)
+        throws ResourceNotFoundException
+    {
+        return m_policyCore.findResource(m_module, name);
+    }
+
+    public String findLibrary(String name)
+    {
+        return m_policyCore.findLibrary(m_module, name);
+    }
+
+    public R4Export[] getExports()
+    {
+        return m_policyCore.getExports(m_module);
+    }
+
+    public void setExports(R4Export[] exports)
+    {
+        m_policyCore.setExports(m_module, exports);
+    }
+
+    public R4Import[] getImports()
+    {
+        return m_policyCore.getImports(m_module);
+    }
+
+    public void setImports(R4Import[] imports)
+    {
+        m_policyCore.setImports(m_module, imports);
+    }
+
+    public R4Import[] getDynamicImports()
+    {
+        return m_policyCore.getDynamicImports(m_module);
+    }
+
+    public void setDynamicImports(R4Import[] imports)
+    {
+        m_policyCore.setDynamicImports(m_module, imports);
+    }
+
+    public R4Library[] getLibraries()
+    {
+        return m_policyCore.getLibraries(m_module);
+    }
+
+    public void setLibraries(R4Library[] libraries)
+    {
+        m_policyCore.setLibraries(m_module, libraries);
+    }
+
+    public R4Wire[] getWires()
+    {
+        return m_policyCore.getWires(m_module);
+    }
+
+    public void setWires(R4Wire[] wires)
+    {
+        m_policyCore.setWires(m_module, wires);
+    }
+
+    public boolean isResolved()
+    {
+        return m_policyCore.isResolved(m_module);
+    }
+
+    public void setResolved(boolean resolved)
+    {
+        m_policyCore.setResolved(m_module, resolved);
+    }
+
+    public void resolve() throws ResolveException
+    {
+        m_policyCore.resolve(m_module);
+    }
+
+    public void addResolverListener(ResolveListener l)
+    {
+        m_policyCore.addResolverListener(l);
+    }
+
+    public void removeResolverListener(ResolveListener l)
+    {
+        m_policyCore.removeResolverListener(l);
+    }
+
+    public String toString()
+    {
+        return m_module.toString();
+    }
+}
\ No newline at end of file

Propchange: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native