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 2010/01/20 18:37:36 UTC
svn commit: r901296 - in
/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework:
./ resolver/
Author: rickhall
Date: Wed Jan 20 17:37:35 2010
New Revision: 901296
URL: http://svn.apache.org/viewvc?rev=901296&view=rev
Log:
More fixes.
Added:
felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/WireImpl.java
Modified:
felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java
felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java
felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExtensionManager.java
felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java
felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/PackageAdminImpl.java
felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java
felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java
Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java?rev=901296&r1=901295&r2=901296&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java (original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java Wed Jan 20 17:37:35 2010
@@ -20,13 +20,12 @@
import java.lang.ref.WeakReference;
import java.net.MalformedURLException;
-import java.net.URL;
import java.security.CodeSource;
import java.security.Permission;
import java.security.ProtectionDomain;
import java.security.cert.Certificate;
-import org.apache.felix.moduleloader.IModule;
+import org.apache.felix.framework.candidateset.Module;
public class BundleProtectionDomain extends ProtectionDomain
{
@@ -56,9 +55,9 @@
m_toString = "[" + bundle + "]";
}
- IModule getModule()
+ Module getModule()
{
- return (IModule) m_module.get();
+ return (Module) m_module.get();
}
public boolean implies(Permission permission)
Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java?rev=901296&r1=901295&r2=901296&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java (original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExportedPackageImpl.java Wed Jan 20 17:37:35 2010
@@ -18,8 +18,8 @@
*/
package org.apache.felix.framework;
-import org.apache.felix.framework.util.manifestparser.Capability;
-import org.apache.felix.moduleloader.IModule;
+import org.apache.felix.framework.candidateset.Capability;
+import org.apache.felix.framework.candidateset.Module;
import org.osgi.framework.Bundle;
import org.osgi.framework.Version;
import org.osgi.service.packageadmin.ExportedPackage;
@@ -28,18 +28,22 @@
{
private final Felix m_felix;
private final BundleImpl m_exportingBundle;
- private final IModule m_exportingModule;
+ private final Module m_exportingModule;
private final Capability m_export;
- private volatile String m_toString = null;
- private volatile String m_versionString = null;
+ private final String m_pkgName;
+ private final Version m_version;
public ExportedPackageImpl(
- Felix felix, BundleImpl exporter, IModule module, Capability export)
+ Felix felix, BundleImpl exporter, Module module, Capability export)
{
m_felix = felix;
m_exportingBundle = exporter;
m_exportingModule = module;
m_export = export;
+ m_pkgName = (String) m_export.getAttribute(Capability.PACKAGE_ATTR).getValue();
+ m_version = (m_export.getAttribute(Capability.VERSION_ATTR) == null)
+ ? Version.emptyVersion
+ : (Version) m_export.getAttribute(Capability.VERSION_ATTR).getValue();
}
public Bundle getExportingBundle()
@@ -64,25 +68,17 @@
public String getName()
{
- return m_export.getPackageName();
+ return m_pkgName;
}
public String getSpecificationVersion()
{
- if (m_versionString == null)
- {
- m_versionString = (m_export.getPackageVersion() == null)
- ? Version.emptyVersion.toString()
- : m_export.getPackageVersion().toString();
- }
- return m_versionString;
+ return m_version.toString();
}
public Version getVersion()
{
- return (m_export.getPackageVersion() == null)
- ? Version.emptyVersion
- : m_export.getPackageVersion();
+ return m_version;
}
public boolean isRemovalPending()
@@ -92,11 +88,6 @@
public String toString()
{
- if (m_toString == null)
- {
- m_toString = m_export.getPackageName()
- + "; version=" + getSpecificationVersion();
- }
- return m_toString;
+ return m_pkgName + "; version=" + m_version;
}
}
\ No newline at end of file
Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExtensionManager.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExtensionManager.java?rev=901296&r1=901295&r2=901296&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExtensionManager.java (original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ExtensionManager.java Wed Jan 20 17:37:35 2010
@@ -38,17 +38,16 @@
import java.util.Set;
import org.apache.felix.framework.Felix.FelixResolver;
-import org.apache.felix.framework.ModuleImpl;
+import org.apache.felix.framework.candidateset.Attribute;
+import org.apache.felix.framework.candidateset.Capability;
+import org.apache.felix.framework.candidateset.Directive;
+import org.apache.felix.framework.candidateset.Module;
import org.apache.felix.framework.util.FelixConstants;
import org.apache.felix.framework.util.StringMap;
import org.apache.felix.framework.util.Util;
-import org.apache.felix.framework.util.manifestparser.Capability;
+import org.apache.felix.framework.util.manifestparser.CapabilityImpl;
import org.apache.felix.framework.util.manifestparser.ManifestParser;
-import org.apache.felix.framework.util.manifestparser.R4Attribute;
-import org.apache.felix.framework.util.manifestparser.R4Directive;
-import org.apache.felix.moduleloader.ICapability;
import org.apache.felix.moduleloader.IContent;
-import org.apache.felix.moduleloader.IModule;
import org.osgi.framework.AdminPermission;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
@@ -119,8 +118,8 @@
private final Logger m_logger;
private final Map m_headerMap = new StringMap(false);
- private final IModule m_systemBundleModule;
- private ICapability[] m_capabilities = null;
+ private final Module m_systemBundleModule;
+ private List<Capability> m_capabilities = null;
private Set m_exportNames = null;
private Object m_securityContext = null;
private final List m_extensions;
@@ -188,12 +187,12 @@
{
ManifestParser mp = new ManifestParser(
m_logger, felix.getConfig(), m_systemBundleModule, m_headerMap);
- ICapability[] caps = aliasSymbolicName(mp.getCapabilities());
+ List<Capability> caps = aliasSymbolicName(mp.getCapabilities());
setCapabilities(caps);
}
catch (Exception ex)
{
- m_capabilities = new ICapability[0];
+ m_capabilities = new ArrayList<Capability>(0);
m_logger.log(
Logger.LOG_ERROR,
"Error parsing system bundle export statement: "
@@ -201,39 +200,39 @@
}
}
- private static ICapability[] aliasSymbolicName(ICapability[] caps)
+ private static List<Capability> aliasSymbolicName(List<Capability> caps)
{
if (caps == null)
{
- return new ICapability[0];
+ return new ArrayList<Capability>(0);
}
- ICapability[] aliasCaps = new ICapability[caps.length];
- System.arraycopy(caps, 0, aliasCaps, 0, caps.length);
+ List<Capability> aliasCaps = new ArrayList<Capability>(caps);
- for (int capIdx = 0; capIdx < aliasCaps.length; capIdx++)
+ for (int capIdx = 0; capIdx < aliasCaps.size(); capIdx++)
{
// Get the attributes and search for bundle symbolic name.
- R4Attribute[] attrs = ((Capability) aliasCaps[capIdx]).getAttributes();
- for (int i = 0; i < attrs.length; i++)
+ List<Attribute> attrs = aliasCaps.get(capIdx).getAttributes();
+ for (int i = 0; i < attrs.size(); i++)
{
// If there is a bundle symbolic name attribute, add the
// standard alias as a value.
- if (attrs[i].getName().equalsIgnoreCase(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE))
+ if (attrs.get(i).getName().equalsIgnoreCase(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE))
{
// Make a copy of the attribute array.
- R4Attribute[] aliasAttrs = new R4Attribute[attrs.length];
- System.arraycopy(attrs, 0, aliasAttrs, 0, attrs.length);
+ List<Attribute> aliasAttrs = new ArrayList<Attribute>(attrs);
// Add the aliased value.
- aliasAttrs[i] = new R4Attribute(
+ aliasAttrs.set(i, new Attribute(
Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE,
- new String[] { (String) attrs[i].getValue(), Constants.SYSTEM_BUNDLE_SYMBOLICNAME }, false);
+ new String[] {
+ (String) attrs.get(i).getValue(), Constants.SYSTEM_BUNDLE_SYMBOLICNAME},
+ false));
// Create the aliased capability to replace the old capability.
- aliasCaps[capIdx] = new Capability(
- caps[capIdx].getModule(),
- caps[capIdx].getNamespace(),
- ((Capability) caps[capIdx]).getDirectives(),
- aliasAttrs);
+ aliasCaps.set(capIdx, new CapabilityImpl(
+ caps.get(capIdx).getModule(),
+ caps.get(capIdx).getNamespace(),
+ caps.get(capIdx).getDirectives(),
+ aliasAttrs));
// Continue with the next capability.
break;
}
@@ -243,7 +242,7 @@
return aliasCaps;
}
- public IModule getModule()
+ public Module getModule()
{
return m_systemBundleModule;
}
@@ -295,7 +294,7 @@
throw new SecurityException("Extension Bundles must have AllPermission");
}
- R4Directive dir = ManifestParser.parseExtensionBundleHeader((String)
+ Directive dir = ManifestParser.parseExtensionBundleHeader((String)
bundle.getCurrentModule().getHeaders().get(Constants.FRAGMENT_HOST));
// We only support classpath extensions (not bootclasspath).
@@ -312,11 +311,11 @@
// bundle.setExtension(true);
// Merge the exported packages with the exported packages of the systembundle.
- ICapability[] exports = null;
+ List<Capability> exports = null;
try
{
exports = ManifestParser.parseExportHeader(
- m_systemBundleModule,
+ m_logger, m_systemBundleModule,
(String) bundle.getCurrentModule().getHeaders().get(Constants.EXPORT_PACKAGE),
m_systemBundleModule.getSymbolicName(), m_systemBundleModule.getVersion());
exports = aliasSymbolicName(exports);
@@ -344,9 +343,9 @@
throw new UnsupportedOperationException(
"Unable to add extension bundle to FrameworkClassLoader - Maybe not an URLClassLoader?");
}
- ICapability[] temp = new ICapability[m_capabilities.length + exports.length];
- System.arraycopy(m_capabilities, 0, temp, 0, m_capabilities.length);
- System.arraycopy(exports, 0, temp, m_capabilities.length, exports.length);
+ List<Capability> temp = new ArrayList<Capability>(m_capabilities.size() + exports.size());
+ temp.addAll(m_capabilities);
+ temp.addAll(exports);
setCapabilities(temp);
}
catch (Exception ex)
@@ -415,7 +414,7 @@
}
}
- private void setCapabilities(ICapability[] capabilities)
+ private void setCapabilities(List<Capability> capabilities)
{
m_capabilities = capabilities;
m_headerMap.put(Constants.EXPORT_PACKAGE, convertCapabilitiesToHeaders(m_headerMap));
@@ -426,9 +425,9 @@
StringBuffer exportSB = new StringBuffer("");
Set exportNames = new HashSet();
- for (int i = 0; (m_capabilities != null) && (i < m_capabilities.length); i++)
+ for (int i = 0; (m_capabilities != null) && (i < m_capabilities.size()); i++)
{
- if (m_capabilities[i].getNamespace().equals(ICapability.PACKAGE_NAMESPACE))
+ if (m_capabilities.get(i).getNamespace().equals(Capability.PACKAGE_NAMESPACE))
{
// Add a comma separate if there is an existing package.
if (exportSB.length() > 0)
@@ -437,13 +436,13 @@
}
// Append exported package information.
- exportSB.append(((Capability) m_capabilities[i]).getPackageName());
+ exportSB.append(m_capabilities.get(i).getAttribute(Capability.PACKAGE_ATTR).getValue());
exportSB.append("; version=\"");
- exportSB.append(((Capability) m_capabilities[i]).getPackageVersion().toString());
+ exportSB.append(m_capabilities.get(i).getAttribute(Capability.VERSION_ATTR).getValue());
exportSB.append("\"");
// Remember exported packages.
- exportNames.add(((Capability) m_capabilities[i]).getPackageName());
+ exportNames.add(m_capabilities.get(i).getAttribute(Capability.PACKAGE_ATTR).getValue());
}
}
@@ -651,7 +650,7 @@
}
}
- public ICapability[] getCapabilities()
+ public List<Capability> getCapabilities()
{
synchronized (ExtensionManager.this)
{
Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java?rev=901296&r1=901295&r2=901296&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java (original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java Wed Jan 20 17:37:35 2010
@@ -19,15 +19,15 @@
package org.apache.felix.framework;
import java.util.*;
+import org.apache.felix.framework.candidateset.Module;
import org.apache.felix.framework.util.Util;
-import org.apache.felix.moduleloader.IModule;
class FindEntriesEnumeration implements Enumeration
{
private final BundleImpl m_bundle;
- private final Enumeration[] m_enumerations;
- private final IModule[] m_modules;
+ private final List<Enumeration> m_enumerations;
+ private final List<Module> m_modules;
private int m_moduleIndex = 0;
private final String m_path;
private final String[] m_filePattern;
@@ -38,23 +38,20 @@
BundleImpl bundle, String path, String filePattern, boolean recurse)
{
m_bundle = bundle;
- IModule bundleModule = m_bundle.getCurrentModule();
- IModule[] fragmentModules = ((ModuleImpl) bundleModule).getFragments();
+ Module bundleModule = m_bundle.getCurrentModule();
+ List<Module> fragmentModules = ((ModuleImpl) bundleModule).getFragments();
if (fragmentModules == null)
{
- fragmentModules = new IModule[0];
+ fragmentModules = new ArrayList<Module>(0);
}
- m_modules = new IModule[fragmentModules.length + 1];
- m_modules[0] = bundleModule;
- for (int i = 0; i < fragmentModules.length; i++)
+ m_modules = new ArrayList<Module>(fragmentModules.size() + 1);
+ m_modules.add(bundleModule);
+ m_modules.addAll(fragmentModules);
+ m_enumerations = new ArrayList<Enumeration>(m_modules.size());
+ for (int i = 0; i < m_modules.size(); i++)
{
- m_modules[i + 1] = fragmentModules[i];
- }
- m_enumerations = new Enumeration[m_modules.length];
- for (int i = 0; i < m_modules.length; i++)
- {
- m_enumerations[i] = m_modules[i].getContent() != null ?
- m_modules[i].getContent().getEntries() : null;
+ m_enumerations.add(m_modules.get(i).getContent() != null ?
+ m_modules.get(i).getContent().getEntries() : null);
}
m_recurse = recurse;
@@ -109,13 +106,13 @@
{
return null;
}
- while (m_moduleIndex < m_enumerations.length)
+ while (m_moduleIndex < m_enumerations.size())
{
- while (m_enumerations[m_moduleIndex] != null
- && m_enumerations[m_moduleIndex].hasMoreElements())
+ while (m_enumerations.get(m_moduleIndex) != null
+ && m_enumerations.get(m_moduleIndex).hasMoreElements())
{
// Get the next entry name.
- String entryName = (String) m_enumerations[m_moduleIndex].nextElement();
+ String entryName = (String) m_enumerations.get(m_moduleIndex).nextElement();
// Check to see if it is a descendent of the specified path.
if (!entryName.equals(m_path) && entryName.startsWith(m_path))
{
@@ -141,7 +138,7 @@
if (Util.checkSubstring(m_filePattern, lastElement))
{
// Convert entry name into an entry URL.
- return m_modules[m_moduleIndex].getEntry(entryName);
+ return m_modules.get(m_moduleIndex).getEntry(entryName);
}
}
}
Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/PackageAdminImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/PackageAdminImpl.java?rev=901296&r1=901295&r2=901296&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/PackageAdminImpl.java (original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/PackageAdminImpl.java Wed Jan 20 17:37:35 2010
@@ -19,13 +19,16 @@
package org.apache.felix.framework;
import java.util.*;
-
-import org.apache.felix.framework.ModuleImpl;
-import org.apache.felix.framework.util.Util;
+import org.apache.felix.framework.candidateset.Module;
import org.apache.felix.framework.util.VersionRange;
-import org.apache.felix.moduleloader.IModule;
-import org.osgi.framework.*;
-import org.osgi.service.packageadmin.*;
+import org.osgi.framework.AdminPermission;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
+import org.osgi.service.packageadmin.ExportedPackage;
+import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.service.packageadmin.RequiredBundle;
+
class PackageAdminImpl implements PackageAdmin, Runnable
{
@@ -191,14 +194,14 @@
if ((getBundleType(bundle) & BUNDLE_TYPE_FRAGMENT) == 0)
{
// Get attached fragments.
- IModule[] modules =
+ List<Module> modules =
((ModuleImpl)
((BundleImpl) bundle).getCurrentModule()).getFragments();
// Convert fragment modules to bundles.
List list = new ArrayList();
- for (int i = 0; (modules != null) && (i < modules.length); i++)
+ for (int i = 0; (modules != null) && (i < modules.size()); i++)
{
- Bundle b = modules[i].getBundle();
+ Bundle b = modules.get(i).getBundle();
if (b != null)
{
list.add(b);
Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java?rev=901296&r1=901295&r2=901296&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java (original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java Wed Jan 20 17:37:35 2010
@@ -18,16 +18,11 @@
*/
package org.apache.felix.framework;
-import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.apache.felix.framework.ModuleImpl;
-import org.apache.felix.framework.util.Util;
-import org.apache.felix.moduleloader.ICapability;
-import org.apache.felix.moduleloader.IModule;
+import org.apache.felix.framework.candidateset.Module;
import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
import org.osgi.framework.Version;
import org.osgi.service.packageadmin.RequiredBundle;
@@ -67,17 +62,17 @@
// of the dependent modules.
Set bundleSet = new HashSet();
// Loop through all of this bundle's modules.
- IModule[] modules = m_bundle.getModules();
+ Module[] modules = m_bundle.getModules();
for (int modIdx = 0; (modules != null) && (modIdx < modules.length); modIdx++)
{
// For each of this bundle's modules, loop through all of the
// modules that require it and add them to the module list.
- IModule[] dependents = ((ModuleImpl) modules[modIdx]).getDependentRequirers();
- for (int depIdx = 0; (dependents != null) && (depIdx < dependents.length); depIdx++)
+ List<Module> dependents = ((ModuleImpl) modules[modIdx]).getDependentRequirers();
+ for (int depIdx = 0; (dependents != null) && (depIdx < dependents.size()); depIdx++)
{
- if (dependents[depIdx].getBundle() != null)
+ if (dependents.get(depIdx).getBundle() != null)
{
- bundleSet.add(dependents[depIdx].getBundle());
+ bundleSet.add(dependents.get(depIdx).getBundle());
}
}
}
Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java?rev=901296&r1=901295&r2=901296&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java (original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java Wed Jan 20 17:37:35 2010
@@ -22,12 +22,12 @@
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.*;
+import org.apache.felix.framework.candidateset.Module;
+import org.apache.felix.framework.candidateset.Wire;
import org.apache.felix.framework.util.MapToDictionary;
import org.apache.felix.framework.util.StringMap;
import org.apache.felix.framework.util.Util;
-import org.apache.felix.moduleloader.IModule;
-import org.apache.felix.moduleloader.IWire;
import org.osgi.framework.*;
import org.osgi.framework.BundleReference;
@@ -434,12 +434,12 @@
// Get the package.
String pkgName =
Util.getClassPackage(className);
- IModule requesterModule = ((BundleImpl) requester).getCurrentModule();
+ Module requesterModule = ((BundleImpl) requester).getCurrentModule();
// Get package wiring from service requester.
- IWire requesterWire = Util.getWire(requesterModule, pkgName);
+ Wire requesterWire = Util.getWire(requesterModule, pkgName);
// Get package wiring from service provider.
- IModule providerModule = ((BundleImpl) m_bundle).getCurrentModule();
- IWire providerWire = Util.getWire(providerModule, pkgName);
+ Module providerModule = ((BundleImpl) m_bundle).getCurrentModule();
+ Wire providerWire = Util.getWire(providerModule, pkgName);
// There are four situations that may occur here:
// 1. Neither the requester, nor provider have wires for the package.
Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java?rev=901296&r1=901295&r2=901296&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java (original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java Wed Jan 20 17:37:35 2010
@@ -23,14 +23,14 @@
import java.net.URL;
import java.net.URLConnection;
import java.security.Permission;
+import org.apache.felix.framework.candidateset.Module;
import org.apache.felix.framework.util.Util;
-import org.apache.felix.moduleloader.IModule;
class URLHandlersBundleURLConnection extends URLConnection
{
private Felix m_framework;
- private IModule m_targetModule;
+ private Module m_targetModule;
private int m_classPathIdx = -1;
private int m_contentLength;
private long m_contentTime;
@@ -77,7 +77,7 @@
m_contentTime = bundle.getLastModified();
int revision = Util.getModuleRevisionFromModuleId(url.getHost());
- IModule[] modules = bundle.getModules();
+ Module[] modules = bundle.getModules();
if ((modules == null) || (revision >= modules.length))
{
throw new IOException("Resource does not exist: " + url);
Added: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/WireImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/WireImpl.java?rev=901296&view=auto
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/WireImpl.java (added)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/WireImpl.java Wed Jan 20 17:37:35 2010
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.resolver;
+
+import java.net.URL;
+import java.util.Enumeration;
+import org.apache.felix.framework.candidateset.Capability;
+import org.apache.felix.framework.candidateset.Module;
+import org.apache.felix.framework.candidateset.Requirement;
+import org.apache.felix.framework.candidateset.Wire;
+import org.apache.felix.moduleloader.ResourceNotFoundException;
+
+public class WireImpl implements Wire
+{
+ private final Module m_importer;
+ private final Requirement m_req;
+ private final Module m_exporter;
+ private final Capability m_cap;
+
+ public WireImpl(Module importer, Requirement ip, Module exporter, Capability ep)
+ {
+ m_importer = importer;
+ m_req = ip;
+ m_exporter = exporter;
+ m_cap = ep;
+ }
+
+ public Module getImporter()
+ {
+ return m_importer;
+ }
+
+ public Requirement getRequirement()
+ {
+ return m_req;
+ }
+
+ public Module getExporter()
+ {
+ return m_exporter;
+ }
+
+ public Capability getCapability()
+ {
+ return m_cap;
+ }
+
+ public String toString()
+ {
+ return m_req + " (" + m_importer + ") -> " + m_cap + " (" + m_exporter + ")";
+ }
+
+ public boolean hasPackage(String pkgName)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public Class getClass(String name) throws ClassNotFoundException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public URL getResource(String name) throws ResourceNotFoundException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public Enumeration getResources(String name) throws ResourceNotFoundException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+}
\ No newline at end of file