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 2011/10/21 19:05:00 UTC
svn commit: r1187467 - in /felix/sandbox/rickhall/obr-resolver: ./
src/main/java/org/apache/felix/resolver/impl/
src/main/java/org/osgi/framework/resource/
src/main/java/org/osgi/service/resolver/
Author: rickhall
Date: Fri Oct 21 17:04:59 2011
New Revision: 1187467
URL: http://svn.apache.org/viewvc?rev=1187467&view=rev
Log:
Track some changes in the OBR API.
Modified:
felix/sandbox/rickhall/obr-resolver/ (props changed)
felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/Candidates.java
felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/ResolverImpl.java
felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/WireImpl.java
felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/framework/resource/Wire.java
felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/service/resolver/Environment.java
Propchange: felix/sandbox/rickhall/obr-resolver/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct 21 17:04:59 2011
@@ -0,0 +1 @@
+target
Modified: felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/Candidates.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/Candidates.java?rev=1187467&r1=1187466&r2=1187467&view=diff
==============================================================================
--- felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/Candidates.java (original)
+++ felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/Candidates.java Fri Oct 21 17:04:59 2011
@@ -492,7 +492,8 @@ class Candidates
// host actually provides it in its resolved capabilities,
// since it may be a substitutable export.
if (!fragCand.getNamespace().equals(ResourceConstants.WIRING_PACKAGE_NAMESPACE)
- || wire.getProviderWiring().getResourceCapabilities(null).contains(fragCand))
+ || env.getWirings().get(wire.getProvider())
+ .getResourceCapabilities(null).contains(fragCand))
{
// Note that we can just add this as a candidate
// directly, since we know it is already resolved.
Modified: felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/ResolverImpl.java?rev=1187467&r1=1187466&r2=1187467&view=diff
==============================================================================
--- felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/ResolverImpl.java (original)
+++ felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/ResolverImpl.java Fri Oct 21 17:04:59 2011
@@ -572,21 +572,21 @@ public class ResolverImpl implements Fel
// since that requirement will be shared with any other
// matching dynamic imports.
Requirement r = wire.getRequirement();
- if (!r.getResource().equals(wire.getRequirerWiring().getResource())
+ if (!r.getResource().equals(wire.getRequirer())
|| ((r.getDirectives()
.get(ResourceConstants.REQUIREMENT_RESOLUTION_DIRECTIVE) != null)
// TODO: RFC-112 - Need dynamic constant.
&& r.getDirectives()
.get(ResourceConstants.REQUIREMENT_RESOLUTION_DIRECTIVE).equals("dynamic")))
{
- r = new HostedRequirement(wire.getRequirerWiring().getResource(), r);
+ r = new HostedRequirement(wire.getRequirer(), 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.getResource().equals(wire.getProviderWiring().getResource()))
+ if (!c.getResource().equals(wire.getProvider()))
{
- c = new HostedCapability(wire.getProviderWiring().getResource(), c);
+ c = new HostedCapability(wire.getProvider(), c);
}
reqs.add(r);
caps.add(c);
@@ -1691,7 +1691,7 @@ public class ResolverImpl implements Fel
{
Set<String> pkgs = calculateExportedAndReexportedPackages(
env,
- wire.getProviderWiring().getResource(),
+ wire.getProvider(),
new HashSet<String>(),
new HashSet<Resource>());
pkgSpace.addAll(pkgs);
@@ -1733,7 +1733,7 @@ public class ResolverImpl implements Fel
{
calculateExportedAndReexportedPackages(
env,
- wire.getProviderWiring().getResource(),
+ wire.getProvider(),
pkgs,
cycles);
}
Modified: felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/WireImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/WireImpl.java?rev=1187467&r1=1187466&r2=1187467&view=diff
==============================================================================
--- felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/WireImpl.java (original)
+++ felix/sandbox/rickhall/obr-resolver/src/main/java/org/apache/felix/resolver/impl/WireImpl.java Fri Oct 21 17:04:59 2011
@@ -27,24 +27,24 @@ import org.osgi.framework.resource.Wirin
class WireImpl implements Wire
{
- private final Wiring m_requirerWiring;
+ private final Resource m_requirer;
private final Requirement m_req;
- private final Wiring m_providerWiring;
+ private final Resource m_provider;
private final Capability m_cap;
public WireImpl(
Resource requirer, Requirement req,
Resource provider, Capability cap)
{
- m_requirerWiring = new WiringImpl(requirer);
+ m_requirer = requirer;
m_req = req;
- m_providerWiring = new WiringImpl(provider);
+ m_provider = provider;
m_cap = cap;
}
- public Wiring getRequirerWiring()
+ public Resource getRequirer()
{
- return m_requirerWiring;
+ return m_requirer;
}
public Requirement getRequirement()
@@ -52,9 +52,9 @@ class WireImpl implements Wire
return m_req;
}
- public Wiring getProviderWiring()
+ public Resource getProvider()
{
- return m_providerWiring;
+ return m_provider;
}
public Capability getCapability()
@@ -67,41 +67,6 @@ class WireImpl implements Wire
{
return m_req
+ " -> "
- + "[" + m_providerWiring.getResource() + "]";
- }
-
- class WiringImpl implements Wiring
- {
- private final Resource m_resource;
-
- WiringImpl(Resource resource)
- {
- m_resource = resource;
- }
-
- public List<Capability> getResourceCapabilities(String namespace)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public List<Requirement> getResourceRequirements(String namespace)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public List<Wire> getProvidedResourceWires(String namespace)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public List<Wire> getRequiredResourceWires(String namespace)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public Resource getResource()
- {
- return m_resource;
- }
+ + "[" + m_provider + "]";
}
}
\ No newline at end of file
Modified: felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/framework/resource/Wire.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/framework/resource/Wire.java?rev=1187467&r1=1187466&r2=1187467&view=diff
==============================================================================
--- felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/framework/resource/Wire.java (original)
+++ felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/framework/resource/Wire.java Fri Oct 21 17:04:59 2011
@@ -20,7 +20,7 @@ package org.osgi.framework.resource;
* A wire connecting a {@link Capability} to a {@link Requirement}.
*
* @ThreadSafe
- * @version $Id: c099368f7ee5b4c485e58dbc512c9c458e5fa03c $
+ * @version $Id: 41ff1d01d23451a8c7493b138a4093dd21070c95 $
*/
public interface Wire {
/**
@@ -31,33 +31,30 @@ public interface Wire {
Capability getCapability();
/**
- * Return the {@link Requirement} for this wire.
+ * Returns the {@link Requirement} for this wire.
*
* @return The {@link Requirement} for this wire.
*/
Requirement getRequirement();
/**
- * Returns the wiring {@link Wiring#getProvidedResourceWires(String)
- * providing} the {@link #getCapability() capability}.
- *
+ * Returns the resource providing the {@link #getCapability() capability}.
* <p>
- * The resource referenced by the returned wiring may differ from the
- * resource referenced by the {@link #getCapability() capability}.
+ * The returned resource may differ from the resource referenced by the
+ * {@link #getCapability() capability}.
*
- * @return The wiring providing the capability.
+ * @return The resource providing the capability.
*/
- Wiring getProviderWiring();
+ Resource getProvider();
/**
- * Returns the wiring who {@link Wiring#getRequiredResourceWires(String)
- * requires} the {@link #getCapability() capability}.
- *
+ * Returns the resource who {@link #getRequirement() requires} the
+ * {@link #getCapability() capability}.
* <p>
- * The resource referenced by the returned wiring may differ from the
- * resource referenced by the {@link #getRequirement() requirement}.
+ * The returned resource may differ from the resource referenced by the
+ * {@link #getRequirement() requirement}.
*
- * @return The wiring whose requirement is wired to the capability.
+ * @return The resource who requires the capability.
*/
- Wiring getRequirerWiring();
+ Resource getRequirer();
}
Modified: felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/service/resolver/Environment.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/service/resolver/Environment.java?rev=1187467&r1=1187466&r2=1187467&view=diff
==============================================================================
--- felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/service/resolver/Environment.java (original)
+++ felix/sandbox/rickhall/obr-resolver/src/main/java/org/osgi/service/resolver/Environment.java Fri Oct 21 17:04:59 2011
@@ -18,11 +18,11 @@ package org.osgi.service.resolver;
import java.util.Collection;
import java.util.Map;
+
import java.util.SortedSet;
import org.osgi.framework.resource.Capability;
import org.osgi.framework.resource.Requirement;
import org.osgi.framework.resource.Resource;
-import org.osgi.framework.resource.Wire;
import org.osgi.framework.resource.Wiring;
/**
@@ -36,9 +36,9 @@ import org.osgi.framework.resource.Wirin
* to satisfy {@link Requirement requirements} via the
* {@link #findProviders(Requirement)} method</li>
*
- * <li>Constrain solutions via the {@link #getWiring()} method. A wiring
- * consists of a map of existing {@link Resource resources} to {@link Wire
- * wires}.
+ * <li>Constrain solutions via the {@link #getWirings()} method. This provides
+ * a map to link existing resolved {@link Resource resources} to their {@link Wiring
+ * wirings}.
*
* <li>Filter transitive requirements that are brought in as part of a resolve
* operation via the {@link #isEffective(Requirement)}.
@@ -50,7 +50,7 @@ import org.osgi.framework.resource.Wirin
*
* <p>
* A resolver may call the {@link #findProviders(Requirement)},
- * {@link #isEffective(Requirement)} and {@link #getWiring()} method any number of
+ * {@link #isEffective(Requirement)} and {@link #getWirings()} method any number of
* times during a resolve using any thread. Environments may also be shared
* between several resolvers. As such implementors should ensure that this class
* is properly synchronized.
@@ -96,11 +96,11 @@ public interface Environment {
*/
boolean isEffective(Requirement requirement);
- /**
- * An immutable map of wires between revisions. Multiple calls to this method
- * for the same environment object must result in the same set of wires.
- *
- * @return the wires already defined in this environment
- */
- Map<Resource, Wiring> getWirings();
-}
\ No newline at end of file
+ /**
+ * An immutable map of wirings for resources. Multiple calls to this method
+ * for the same environment object must result in the same set of wirings.
+ *
+ * @return the wirings already defined in this environment
+ */
+ Map<Resource, Wiring> getWirings();
+}