Skip to content

Commit

Permalink
Need to wrap requirments and capabilities in wire when they come from
Browse files Browse the repository at this point in the history
fragments. (FELIX-2858)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1080242 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Richard S. Hall committed Mar 10, 2011
1 parent 28dbcf2 commit 7a9a3ce
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Expand Up @@ -479,8 +479,24 @@ private void calculatePackageSpaces(
// Use wires to get actual requirements and satisfying capabilities.
for (Wire wire : module.getWires())
{
reqs.add(wire.getRequirement());
caps.add(wire.getCapability());
// Wrap the requirement as a hosted requirement
// if it comes from a fragment, since we will need
// to know the host.
Requirement r = wire.getRequirement();
if (!r.getModule().equals(wire.getImporter()))
{
r = new WrappedRequirement(wire.getImporter(), r);
}
// Wrap the capability as a hosted capability
// if it comes from a fragment, since we will need
// to know the host.
Capability c = wire.getCapability();
if (!c.getModule().equals(wire.getExporter()))
{
c = new WrappedCapability(wire.getExporter(), c);
}
reqs.add(r);
caps.add(c);
}

// Since the module is resolved, it could be dynamically importing,
Expand Down
Expand Up @@ -137,6 +137,11 @@ public List<Requirement> getRequirements()
return m_cachedRequirements;
}

public String toString()
{
return m_module.getId();
}

public Map getHeaders()
{
throw new UnsupportedOperationException("Not supported yet.");
Expand Down

0 comments on commit 7a9a3ce

Please sign in to comment.