felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r917934 - in /felix/trunk/bundlerepository/src: main/java/org/apache/felix/bundlerepository/ main/java/org/apache/felix/bundlerepository/impl/ main/java/org/apache/felix/bundlerepository/impl/wrapper/ test/java/org/apache/felix/bundlereposi...
Date Tue, 02 Mar 2010 09:47:09 GMT
Author: gnodet
Date: Tue Mar  2 09:47:08 2010
New Revision: 917934

URL: http://svn.apache.org/viewvc?rev=917934&view=rev
Log:
FELIX-2144: API changes:
- remove Resolver#getGlobalRequirements and Resolver#addGlobalRequirement(Requirement)
- add RepositoryAdmin#repository(Resource[]) to create an in memory repository
- remove Capability#getResource()
- remove Requirement#getResource()
- remove Resource#getRepository()
- move Repository#isLocal() to Resource#isLocal()
- new interface Reason (pair of Requirement / Resource)
- change Resolver to use Reason[] for resource selection explanation and unsatisfied requirements

Additional minor changes:
- discoverResources(String) nows throws an InvalidSyntaxException
- remove RepositoryAdmin#deploy(boolean) deprecated to #deploy(int)
- improve resolver by using List instead of arrays for holding reasons / unsatisfied reqs
- add missing ASF headers

Added:
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Reason.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ReasonImpl.java
      - copied, changed from r917746, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapability.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapabilityImpl.java
      - copied, changed from r917746, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java
Modified:
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Capability.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Repository.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdmin.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Requirement.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resolver.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resource.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalResourceImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrCommandImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RequirementImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SystemRepositoryImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java
    felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Capability.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Capability.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Capability.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Capability.java Tue Mar  2 09:47:08 2010
@@ -1,4 +1,22 @@
 /*
+ * 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.
+ */
+/*
  * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Capability.java,v 1.3 2006/03/16 14:56:17 hargrave Exp $
  *
  * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
@@ -46,10 +64,4 @@
      */
     Map getProperties();
 
-    /**
-     * Return the resource this capability belongs to
-     *
-     * @return the resource
-     */
-    Resource getResource();
 }
\ No newline at end of file

Added: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Reason.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Reason.java?rev=917934&view=auto
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Reason.java (added)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Reason.java Tue Mar  2 09:47:08 2010
@@ -0,0 +1,33 @@
+/*
+ * 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.bundlerepository;
+
+/**
+ * A pair of requirement and resource indicating a reason
+ * why a resource has been chosen.
+ * The reason indicates which resource and which requirement
+ * has been satisfied by the selected resource.
+ */
+public interface Reason {
+
+    Resource getResource();
+
+    Requirement getRequirement();
+
+}

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Repository.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Repository.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Repository.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Repository.java Tue Mar  2 09:47:08 2010
@@ -1,4 +1,22 @@
 /*
+ * 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.
+ */
+/*
  * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Repository.java,v 1.3 2006/03/16 14:56:17 hargrave Exp $
  *
  * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
@@ -55,14 +73,4 @@
      */
     long getLastModified();
 
-    /**
-     * Returns whether this repository is a local one
-     * or not.
-     *
-     * Local repositories contains resources that are already available
-     * in the OSGi framework and thus will be preferred over other
-     * resources.
-     */
-    boolean isLocal();
-
 }
\ No newline at end of file

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdmin.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdmin.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdmin.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdmin.java Tue Mar  2 09:47:08 2010
@@ -1,4 +1,22 @@
 /*
+ * 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.
+ */
+/*
  * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/RepositoryAdmin.java,v 1.3 2006/03/16 14:56:17 hargrave Exp $
  *
  * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
@@ -74,7 +92,7 @@
      *            A standard OSGi filter
      * @return List of resources matching the filters.
      */
-    Resource[] discoverResources(String filterExpr);
+    Resource[] discoverResources(String filterExpr) throws InvalidSyntaxException;
 
     /**
      * Discover any resources that match the given requirements.
@@ -146,6 +164,7 @@
      * @param name
      * @param filter
      * @return
+     * @throws InvalidSyntaxException
      */
     Requirement requirement(String name, String filter) throws InvalidSyntaxException;
 
@@ -154,6 +173,7 @@
      *
      * @param filter the string filter
      * @return
+     * @throws InvalidSyntaxException
      */
     Filter filter(String filter) throws InvalidSyntaxException;
 
@@ -162,15 +182,27 @@
      * 
      * @param repository
      * @return
+     * @throws Exception
      */
     Repository repository(URL repository) throws Exception;
 
     /**
+     * Create a repository for the given set of resources.
+     * Such repositories can be used to create a resolver
+     * that would resolve on a subset of available resources
+     * instead of all of them.
+     *
+     * @param resources an array of resources
+     * @return a repository containing the given resources
+     */
+    Repository repository(Resource[] resources);
+
+    /**
      * Create a capability
      *
      * @param name name of this capability
      * @param properties the properties
-     * @return
+     * @return a new capability with the specified name and properties
      */
     Capability capability(String name, Map properties);
 

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Requirement.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Requirement.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Requirement.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Requirement.java Tue Mar  2 09:47:08 2010
@@ -1,4 +1,22 @@
 /*
+ * 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.
+ */
+/*
  * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Requirement.java,v 1.4 2006/03/16 14:56:17 hargrave Exp $
  *
  * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
@@ -24,6 +42,12 @@
 /**
  * A named requirement specifies the need for certain capabilities with the same
  * name.
+ *
+ * A requirement is said to be satisfied by a capability if and only if:
+ * <ul>
+ *   <li>they have the same nsame</li>
+ *   <li>the filter matches the capability properties</li>
+ * </ul>
  * 
  * @version $Revision: 1.4 $
  */
@@ -37,7 +61,6 @@
 
     /**
      * Return the filter.
-     * 
      */
     String getFilter();
 
@@ -57,11 +80,4 @@
      */
     boolean isSatisfied(Capability capability);
 
-    /**
-     * Return the resource this requirement belongs to
-     * or <code>null</code
-     *
-     * @return the resource
-     */
-    Resource getResource();
 }
\ No newline at end of file

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resolver.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resolver.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resolver.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resolver.java Tue Mar  2 09:47:08 2010
@@ -1,4 +1,22 @@
 /*
+ * 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.
+ */
+/*
  * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Resolver.java,v 1.3 2006/03/16 14:56:17 hargrave Exp $
  *
  * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
@@ -82,27 +100,6 @@
      */
     Capability[] getGlobalCapabilities();
 
-    /**
-     * Add a global requirement.
-     *
-     * A global requirement is a requirement that must be satisfied by all
-     * resources.  Such requirements are usually built using an
-     *    IF x then Y
-     * which can be expressed using the following logical expression
-     *    !X OR (X AND Y)
-     * which can be translated to the following filter
-     *    (|(!(x))(&(x)(y))
-     *
-     * @param requirement
-     */
-    void addGlobalRequirement(Requirement requirement);
-
-    /**
-     * Returns a list of global requirements
-     * @return
-     */
-    Requirement[] getGlobalRequirements();
-
    /**
      * Start the resolution process and return whether the constraints have
      * been successfully met or not.
@@ -122,17 +119,32 @@
      */
     boolean resolve(int flags) throws InterruptedResolutionException;
 
-    Requirement[] getUnsatisfiedRequirements();
+    /**
+     * List of mandatory resources that need to be installed
+     * @return
+     */
+    Resource[] getRequiredResources();
 
+    /**
+     * List of optional resources that may be installed
+     * @return
+     */
     Resource[] getOptionalResources();
 
-    Requirement[] getReason(Resource resource);
-
-    Resource[] getResources(Requirement requirement);
-
-    Resource[] getRequiredResources();
+    /**
+     * List of reasons why a resource has been included either as a mandatory or
+     * optional resource during the resolution.
+     *
+     * @param resource
+     * @return an array of Reason
+     */
+    Reason[] getReason(Resource resource);
 
-    void deploy(boolean start);
+    /**
+     * List of requirements that could not be satisfied during the resolution
+     * @return
+     */
+    Reason[] getUnsatisfiedRequirements();
 
     void deploy(int flags);
 }
\ No newline at end of file

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resource.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resource.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resource.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resource.java Tue Mar  2 09:47:08 2010
@@ -1,4 +1,22 @@
 /*
+ * 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.
+ */
+/*
  * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Resource.java,v 1.5 2006/03/16 14:56:17 hargrave Exp $
  *
  * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
@@ -46,6 +64,8 @@
 
     final String SOURCE_URL = "source";
 
+    final String JAVADOC_URL = "javadoc";
+
     final String SYMBOLIC_NAME = "symbolicname";
 
     final String PRESENTATION_NAME = "presentationname";
@@ -60,8 +80,6 @@
 
     final String CATEGORY = "category";
 
-    final String JAVADOC = "javadoc";
-
     // get readable name
 
     Map getProperties();
@@ -82,6 +100,12 @@
 
     String[] getCategories();
 
-    Repository getRepository();
+    /**
+     * Returns whether this resource is a local one or not.
+     *
+     * Local resources are already available in the OSGi framework and thus will be
+     * preferred over other resources.
+     */
+    boolean isLocal();
 
 }
\ No newline at end of file

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java Tue Mar  2 09:47:08 2010
@@ -25,7 +25,6 @@
 
 public class CapabilityImpl implements Capability
 {
-    private ResourceImpl m_resource;
     private String m_name = null;
     private final Map m_map = new HashMap();
 
@@ -33,16 +32,6 @@
     {
     }
 
-    public Resource getResource()
-    {
-        return m_resource;
-    }
-
-    public void setResource(ResourceImpl resource)
-    {
-        m_resource = resource;
-    }
-
     public String getName()
     {
         return m_name;

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java Tue Mar  2 09:47:08 2010
@@ -143,11 +143,6 @@
         return (Resource[]) m_localResourceList.values().toArray(new Resource[m_localResourceList.size()]);
     }
 
-    public boolean isLocal()
-    {
-        return true;
-    }
-
     private void initialize()
     {
         // register for bundle and service events now

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalResourceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalResourceImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalResourceImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalResourceImpl.java Tue Mar  2 09:47:08 2010
@@ -49,6 +49,11 @@
         initialize();
     }
 
+    public boolean isLocal()
+    {
+        return true;
+    }
+
     public Bundle getBundle()
     {
         return m_bundle;

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrCommandImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrCommandImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrCommandImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrCommandImpl.java Tue Mar  2 09:47:08 2010
@@ -24,7 +24,9 @@
 import java.util.*;
 
 import org.apache.felix.bundlerepository.Capability;
+import org.apache.felix.bundlerepository.Reason;
 import org.apache.felix.bundlerepository.Requirement;
+import org.apache.felix.bundlerepository.Resolver;
 import org.apache.felix.bundlerepository.Resource;
 import org.apache.felix.shell.Command;
 import org.osgi.framework.*;
@@ -396,7 +398,7 @@
                 try
                 {
                     out.print("\nDeploying...");
-                    resolver.deploy(command.equals(START_CMD));
+                    resolver.deploy(command.equals(START_CMD) ? Resolver.START : 0);
                     out.println("done.");
                 }
                 catch (IllegalStateException ex)
@@ -406,19 +408,15 @@
             }
             else
             {
-                Requirement[] reqs = resolver.getUnsatisfiedRequirements();
+                Reason[] reqs = resolver.getUnsatisfiedRequirements();
                 if ((reqs != null) && (reqs.length > 0))
                 {
                     out.println("Unsatisfied requirement(s):");
                     printUnderline(out, 27);
                     for (int reqIdx = 0; reqIdx < reqs.length; reqIdx++)
                     {
-                        out.println("   " + reqs[reqIdx].getFilter());
-                        Resource[] resources = resolver.getResources(reqs[reqIdx]);
-                        for (int resIdx = 0; resIdx < resources.length; resIdx++)
-                        {
-                            out.println("      " + resources[resIdx].getPresentationName());
-                        }
+                        out.println("   " + reqs[reqIdx].getRequirement().getFilter());
+                        out.println("      " + reqs[reqIdx].getResource().getPresentationName());
                     }
                 }
                 else
@@ -491,7 +489,7 @@
         }
     }
 
-    private Resource[] searchRepository(String targetId, String targetVersion)
+    private Resource[] searchRepository(String targetId, String targetVersion) throws InvalidSyntaxException
     {
         // Try to see if the targetId is a bundle ID.
         try

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService.java Tue Mar  2 09:47:08 2010
@@ -109,22 +109,29 @@
 
         URL remoteURL = null;
 
-        Bundle[] bundles = m_bundleContext.getBundles();
-
-        int i = 0;
-        while ((remoteURL == null) && (i < bundles.length))
+        try
         {
-            if (url.equals(bundles[i].getLocation()))
+            Bundle[] bundles = m_bundleContext.getBundles();
+
+            int i = 0;
+            while ((remoteURL == null) && (i < bundles.length))
             {
-                remoteURL = getRemoteUrlForBundle(bundles[i]);
+                if (url.equals(bundles[i].getLocation()))
+                {
+                    remoteURL = getRemoteUrlForBundle(bundles[i]);
+                }
+                i++;
             }
-            i++;
-        }
 
-        if (remoteURL == null)
+            if (remoteURL == null)
+            {
+                String path = u.getPath();
+                remoteURL = getRemoteObrInstallUrl(path);
+            }
+        }
+        catch (InvalidSyntaxException e)
         {
-            String path = u.getPath();
-            remoteURL = getRemoteObrInstallUrl(path);
+            throw (IOException) new IOException().initCause(e);
         }
 
         return remoteURL.openConnection();
@@ -140,7 +147,7 @@
      * @return the remote URL of the resolved bundle
      * @throws IOException if an error occurs
      */
-    private URL getRemoteObrInstallUrl(String path) throws IOException
+    private URL getRemoteObrInstallUrl(String path) throws IOException, InvalidSyntaxException
     {
         if( path == null || path.trim().length() == 0 )
         {
@@ -199,7 +206,7 @@
      * @return remote url
      * @throws IOException if something went wrong
      */
-    private URL getRemoteUrlForBundle(Bundle bundle) throws IOException
+    private URL getRemoteUrlForBundle(Bundle bundle) throws IOException, InvalidSyntaxException
     {
         String symbolicName = bundle.getSymbolicName();
         String version = (String) bundle.getHeaders().get(Constants.BUNDLE_VERSION);

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ReasonImpl.java (from r917746, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ReasonImpl.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ReasonImpl.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java&r1=917746&r2=917934&rev=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ReasonImpl.java Tue Mar  2 09:47:08 2010
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -18,58 +18,29 @@
  */
 package org.apache.felix.bundlerepository.impl;
 
-import java.util.*;
-
-import org.apache.felix.bundlerepository.Capability;
+import org.apache.felix.bundlerepository.Reason;
+import org.apache.felix.bundlerepository.Requirement;
 import org.apache.felix.bundlerepository.Resource;
 
-public class CapabilityImpl implements Capability
+public class ReasonImpl implements Reason
 {
-    private ResourceImpl m_resource;
-    private String m_name = null;
-    private final Map m_map = new HashMap();
-
-    public CapabilityImpl()
-    {
-    }
-
-    public Resource getResource()
-    {
-        return m_resource;
-    }
-
-    public void setResource(ResourceImpl resource)
-    {
-        m_resource = resource;
-    }
-
-    public String getName()
-    {
-        return m_name;
-    }
-
-    public void setName(String name)
-    {
-        m_name = name.intern();
-    }
 
-    public Map getProperties()
-    {
-        return m_map;
-    }
+    private final Resource resource;
+    private final Requirement requirement;
 
-    protected void addP(PropertyImpl prop)
+    public ReasonImpl(Resource resource, Requirement requirement)
     {
-        addP(prop.getN(), prop.getV());
+        this.resource = resource;
+        this.requirement = requirement;
     }
 
-    protected void addP(String name, Object value)
+    public Resource getResource()
     {
-        m_map.put(name.toLowerCase(), value);
+        return resource;
     }
 
-    public String toString()
+    public Requirement getRequirement()
     {
-        return m_name  + ":" + m_map.toString();
+        return requirement;
     }
-}
\ No newline at end of file
+}

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java Tue Mar  2 09:47:08 2010
@@ -119,12 +119,10 @@
         {
             initialize();
         }
-
         List repositories = new ArrayList();
         repositories.add(m_system);
         repositories.add(m_local);
         repositories.addAll(m_repoMap.values());
-
         return resolver((Repository[]) repositories.toArray(new Repository[repositories.size()]));
     }
 
@@ -134,32 +132,22 @@
         {
             initialize();
         }
-
+        if (repositories == null)
+        {
+            return resolver();
+        }
         return new ResolverImpl(m_context, repositories, m_logger);
     }
 
-    public synchronized Resource[] discoverResources(String filterExpr)
+    public synchronized Resource[] discoverResources(String filterExpr) throws InvalidSyntaxException
     {
         if (!m_initialized)
         {
             initialize();
         }
 
-        Filter filter = null;
-        try
-        {
-            filter = m_context.createFilter(filterExpr);
-        }
-        catch (InvalidSyntaxException ex)
-        {
-            m_logger.log(
-                Logger.LOG_WARNING,
-                "Error while discovering resources for " + filterExpr,
-                ex);
-            return new Resource[0];
-        }
-
-        Resource[] resources = null;
+        Filter filter = filterExpr != null ? filter(filterExpr) : null;
+        Resource[] resources;
         MapToDictionary dict = new MapToDictionary(null);
         Repository[] repos = listRepositories();
         List matchList = new ArrayList();
@@ -169,7 +157,7 @@
             for (int resIdx = 0; (resources != null) && (resIdx < resources.length); resIdx++)
             {
                 dict.setSourceMap(resources[resIdx].getProperties());
-                if (filter.match(dict))
+                if (filter == null || filter.match(dict))
                 {
                     matchList.add(resources[resIdx]);
                 }
@@ -206,8 +194,7 @@
                     Capability[] caps = resources[resIdx].getCapabilities();
                     for (int capIdx = 0; (caps != null) && (capIdx < caps.length); capIdx++)
                     {
-                        if (caps[capIdx].getName().equals(requirements[reqIdx].getName())
-                            && requirements[reqIdx].isSatisfied(caps[capIdx]))
+                        if (requirements[reqIdx].isSatisfied(caps[capIdx]))
                         {
                             reqMatch = true;
                             break;
@@ -253,6 +240,11 @@
         return new RepositoryImpl(null, url, 0, m_logger);
     }
 
+    public Repository repository(Resource[] resources) 
+    {
+        return new RepositoryImpl(resources);
+    }
+
     public Capability capability(String name, Map properties)
     {
         CapabilityImpl cap = new CapabilityImpl();

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryImpl.java Tue Mar  2 09:47:08 2010
@@ -60,6 +60,15 @@
     // Reusable comparator for sorting resources by name.
     private ResourceComparator m_nameComparator = new ResourceComparator();
 
+    public RepositoryImpl(Resource[] resources)
+    {
+        m_repoAdmin = null;
+        m_url = null;
+        m_logger = null;
+        m_resources = resources;
+        m_lastmodified = System.currentTimeMillis();
+    }
+
     public RepositoryImpl(RepositoryAdminImpl repoAdmin, URL url, Logger logger)
         throws Exception
     {
@@ -167,11 +176,6 @@
         }
     }
 
-    public boolean isLocal()
-    {
-        return false;
-    }
-
     /**
      * Default setter method when setting parsed data from the XML file,
      * which currently ignores everything.

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RequirementImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RequirementImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RequirementImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RequirementImpl.java Tue Mar  2 09:47:08 2010
@@ -20,12 +20,10 @@
 
 import org.apache.felix.bundlerepository.Capability;
 import org.apache.felix.bundlerepository.Requirement;
-import org.apache.felix.bundlerepository.Resource;
 import org.osgi.framework.InvalidSyntaxException;
 
 public class RequirementImpl implements Requirement
 {
-    private Resource m_resource;
     private String m_name = null;
     private boolean m_extend = false;
     private boolean m_multiple = false;
@@ -37,16 +35,6 @@
     {
     }
 
-    public Resource getResource()
-    {
-        return m_resource;
-    }
-
-    public void setResource(Resource resource)
-    {
-        m_resource = resource;
-    }
-
     public synchronized String getName()
     {
         return m_name;

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java Tue Mar  2 09:47:08 2010
@@ -33,13 +33,12 @@
     private final Set m_addedSet = new HashSet();
     private final Set m_addedRequirementSet = new HashSet();
     private final Set m_globalCapabilities = new HashSet();
-    private final Set m_globalRequirements = new HashSet();
     private final Set m_failedSet = new HashSet();
     private final Set m_resolveSet = new HashSet();
     private final Set m_requiredSet = new HashSet();
     private final Set m_optionalSet = new HashSet();
     private final Map m_reasonMap = new HashMap();
-    private final Map m_unsatisfiedMap = new HashMap();
+    private final Set m_unsatisfiedSet = new HashSet();
     private boolean m_resolved = false;
     private long m_resolveTimeStamp;
     private int m_resolutionFlags;
@@ -84,24 +83,11 @@
         return (Capability[]) m_globalCapabilities.toArray(new Capability[m_globalCapabilities.size()]);
     }
 
-    public void addGlobalRequirement(Requirement requirement)
-    {
-        m_resolved = false;
-        m_globalRequirements.add(requirement);
-    }
-
-    public Requirement[] getGlobalRequirements()
-    {
-        return (Requirement[]) m_globalRequirements.toArray(new Requirement[m_globalRequirements.size()]);
-    }
-
-    public synchronized Requirement[] getUnsatisfiedRequirements()
+    public synchronized Resource[] getRequiredResources()
     {
         if (m_resolved)
         {
-            return (Requirement[])
-                m_unsatisfiedMap.keySet().toArray(
-                    new Requirement[m_unsatisfiedMap.size()]);
+            return (Resource[]) m_requiredSet.toArray(new Resource[m_requiredSet.size()]);
         }
         throw new IllegalStateException("The resources have not been resolved.");
     }
@@ -110,38 +96,26 @@
     {
         if (m_resolved)
         {
-            return (Resource[])
-                m_optionalSet.toArray(
-                    new Resource[m_optionalSet.size()]);
+            return (Resource[]) m_optionalSet.toArray(new Resource[m_optionalSet.size()]);
         }
         throw new IllegalStateException("The resources have not been resolved.");
     }
 
-    public synchronized Requirement[] getReason(Resource resource)
+    public synchronized Reason[] getReason(Resource resource)
     {
         if (m_resolved)
         {
-            return (Requirement[]) m_reasonMap.get(resource);
+            List l = (List) m_reasonMap.get(resource);
+            return l != null ? (Reason[]) l.toArray(new Reason[l.size()]) : null;
         }
         throw new IllegalStateException("The resources have not been resolved.");
     }
 
-    public synchronized Resource[] getResources(Requirement requirement)
+    public synchronized Reason[] getUnsatisfiedRequirements()
     {
         if (m_resolved)
         {
-            return (Resource[]) m_unsatisfiedMap.get(requirement);
-        }
-        throw new IllegalStateException("The resources have not been resolved.");
-    }
-
-    public synchronized Resource[] getRequiredResources()
-    {
-        if (m_resolved)
-        {
-            return (Resource[])
-                m_requiredSet.toArray(
-                    new Resource[m_requiredSet.size()]);
+            return (Reason[]) m_unsatisfiedSet.toArray(new Reason[m_unsatisfiedSet.size()]);
         }
         throw new IllegalStateException("The resources have not been resolved.");
     }
@@ -151,17 +125,21 @@
         List resources = new ArrayList();
         for (int repoIdx = 0; (m_repositories != null) && (repoIdx < m_repositories.length); repoIdx++)
         {
-            if (m_repositories[repoIdx].isLocal() == local)
+            boolean isLocal = m_repositories[repoIdx] instanceof LocalRepositoryImpl;
+            boolean isSystem = m_repositories[repoIdx] instanceof SystemRepositoryImpl;
+            if (isLocal && (m_resolutionFlags & NO_LOCAL_RESOURCES) != 0) {
+                continue;
+            }
+            if (isSystem && (m_resolutionFlags & NO_SYSTEM_BUNDLE) != 0) {
+                continue;
+            }
+            Resource[] res = m_repositories[repoIdx].getResources();
+            for (int resIdx = 0; (res != null) && (resIdx < res.length); resIdx++)
             {
-                boolean isLocal = m_repositories[repoIdx] instanceof LocalRepositoryImpl;
-                boolean isSystem = m_repositories[repoIdx] instanceof SystemRepositoryImpl;
-                if (isLocal && (m_resolutionFlags & NO_LOCAL_RESOURCES) != 0) {
-                    continue;
-                }
-                if (isSystem && (m_resolutionFlags & NO_SYSTEM_BUNDLE) != 0) {
-                    continue;
+                if (res[resIdx].isLocal() == local)
+                {
+                    resources.add(res[resIdx]);
                 }
-                resources.addAll(Arrays.asList(m_repositories[repoIdx].getResources()));
             }
         }
         return (Resource[]) resources.toArray(new Resource[resources.size()]);
@@ -177,16 +155,12 @@
         // Find resources
         Resource[] locals = getResources(true);
         Resource[] remotes = getResources(false);
-        remotes = filter(remotes, (Requirement[]) m_globalRequirements.toArray(new Requirement[m_globalRequirements.size()]));
 
         // time of the resolution process start
         m_resolveTimeStamp = 0;
         for (int repoIdx = 0; (m_repositories != null) && (repoIdx < m_repositories.length); repoIdx++)
         {
-            if (m_repositories[repoIdx].isLocal())
-            {
-                m_resolveTimeStamp = Math.max(m_resolveTimeStamp, m_repositories[repoIdx].getLastModified());
-            }
+            m_resolveTimeStamp = Math.max(m_resolveTimeStamp, m_repositories[repoIdx].getLastModified());
         }
 
         // Reset instance values.
@@ -195,7 +169,7 @@
         m_requiredSet.clear();
         m_optionalSet.clear();
         m_reasonMap.clear();
-        m_unsatisfiedMap.clear();
+        m_unsatisfiedSet.clear();
         m_resolved = true;
         m_resolutionFlags = flags;
 
@@ -209,13 +183,11 @@
             {
                 Capability cap = (Capability) iter.next();
                 fake.addCapability(cap);
-                ((CapabilityImpl) cap).setResource(null);
             }
             for (Iterator iter = m_addedRequirementSet.iterator(); iter.hasNext();)
             {
                 Requirement req = (Requirement) iter.next();
                 fake.addRequire(req);
-                ((RequirementImpl) req).setResource(null);
             }
             if (!resolve(fake, locals, remotes, false))
             {
@@ -332,7 +304,7 @@
                     // can resolve.
                     while ((candidate == null) && !candidateCapabilities.isEmpty())
                     {
-                        Capability bestCapability = getBestCandidate(candidateCapabilities);
+                        ResourceCapability bestCapability = getBestCandidate(candidateCapabilities);
 
                         // Try to resolve the best resource.
                         if (resolve(bestCapability.getResource(), locals, remotes, optional || reqs[reqIdx].isOptional()))
@@ -351,20 +323,8 @@
                     // The resolve failed.
                     result = false;
                     // Associated the current resource to the requirement
-                    // in the unsatisfied requirement map.
-                    Resource[] resources = (Resource[]) m_unsatisfiedMap.get(reqs[reqIdx]);
-                    if (resources == null)
-                    {
-                        resources = new Resource[] { resource };
-                    }
-                    else
-                    {
-                        Resource[] tmp = new Resource[resources.length + 1];
-                        System.arraycopy(resources, 0, tmp, 0, resources.length);
-                        tmp[resources.length] = resource;
-                        resources = tmp;
-                    }
-                    m_unsatisfiedMap.put(reqs[reqIdx], resources);
+                    // in the unsatisfied requirement set.
+                    m_unsatisfiedSet.add(new ReasonImpl(resource, reqs[reqIdx]));
                 }
                 else if (candidate != null)
                 {
@@ -387,7 +347,13 @@
                         }
 
                         // Add the reason why the candidate was selected.
-                        addReason(candidate, reqs[reqIdx]);
+                        List reasons = (List) m_reasonMap.get(candidate);
+                        if (reasons == null)
+                        {
+                            reasons = new ArrayList();
+                            m_reasonMap.put(candidate, reasons);
+                        }
+                        reasons.add(new ReasonImpl(resource, reqs[reqIdx]));
                     }
                     else
                     {
@@ -450,7 +416,7 @@
                 {
                     if (req.isSatisfied(caps[capIdx]))
                     {
-                        matchingCapabilities.add(caps[capIdx]);
+                        matchingCapabilities.add(new ResourceCapabilityImpl(resources[resIdx], caps[capIdx]));
                     }
                 }
             }
@@ -467,22 +433,22 @@
      * @param caps
      * @return
      */
-    private Capability getBestCandidate(List caps)
+    private ResourceCapability getBestCandidate(List caps)
     {
         Version bestVersion = null;
-        Capability best = null;
+        ResourceCapability best = null;
         boolean bestLocal = false;
 
         for(int capIdx = 0; capIdx < caps.size(); capIdx++)
         {
-            Capability current = (Capability) caps.get(capIdx);
-            boolean isCurrentLocal = current.getResource().getRepository() == null;
+            ResourceCapability current = (ResourceCapability) caps.get(capIdx);
+            boolean isCurrentLocal = current.getResource().isLocal();
 
             if (best == null)
             {
                 best = current;
                 bestLocal = isCurrentLocal;
-                Object v = current.getProperties().get(Resource.VERSION);
+                Object v = current.getCapability().getProperties().get(Resource.VERSION);
                 if ((v != null) && (v instanceof Version))
                 {
                     bestVersion = (Version) v;
@@ -490,7 +456,7 @@
             }
             else if ((m_resolutionFlags & DO_NOT_PREFER_LOCAL) != 0 || !bestLocal || isCurrentLocal)
             {
-                Object v = current.getProperties().get(Resource.VERSION);
+                Object v = current.getCapability().getProperties().get(Resource.VERSION);
 
                 // If there is no version, then select the resource
                 // with the greatest number of capabilities.
@@ -538,11 +504,6 @@
         }
     }
 
-    public synchronized void deploy(boolean start)
-    {
-        deploy(START);
-    }
-
     public synchronized void deploy(int flags)
     {
         m_deployFlags = flags;
@@ -560,8 +521,7 @@
         // to see if the local state changes overlap with the resolver.
         for (int repoIdx = 0; (m_repositories != null) && (repoIdx < m_repositories.length); repoIdx++)
         {
-            if (m_repositories[repoIdx].isLocal()
-                    && m_repositories[repoIdx].getLastModified() > m_resolveTimeStamp)
+            if (m_repositories[repoIdx].getLastModified() > m_resolveTimeStamp)
             {
                 throw new IllegalStateException("Framework state has changed, must resolve again.");
             }
@@ -716,23 +676,6 @@
         return bundle.getHeaders().get(Constants.FRAGMENT_HOST) != null;
     }
     
-    private void addReason(Resource resource, Requirement req)
-    {
-        Requirement[] reasons = (Requirement[]) m_reasonMap.get(resource);
-        if (reasons == null)
-        {
-            reasons = new Requirement[] { req };
-        }
-        else
-        {
-            Requirement[] tmp = new Requirement[reasons.length + 1];
-            System.arraycopy(reasons, 0, tmp, 0, reasons.length);
-            tmp[reasons.length] = req;
-            reasons = tmp;
-        }
-        m_reasonMap.put(resource, reasons);
-    }
-
     // TODO: OBR - Think about this again and make sure that deployment ordering
     // won't impact it...we need to update the local state too.
     private LocalResourceImpl findUpdatableLocalResource(Resource resource)

Added: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapability.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapability.java?rev=917934&view=auto
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapability.java (added)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapability.java Tue Mar  2 09:47:08 2010
@@ -0,0 +1,31 @@
+/*
+ * 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.bundlerepository.impl;
+
+import org.apache.felix.bundlerepository.Capability;
+import org.apache.felix.bundlerepository.Resource;
+
+public interface ResourceCapability
+{
+
+    Resource getResource();
+
+    Capability getCapability();
+
+}

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapabilityImpl.java (from r917746, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapabilityImpl.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapabilityImpl.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java&r1=917746&r2=917934&rev=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceCapabilityImpl.java Tue Mar  2 09:47:08 2010
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -18,58 +18,29 @@
  */
 package org.apache.felix.bundlerepository.impl;
 
-import java.util.*;
-
 import org.apache.felix.bundlerepository.Capability;
 import org.apache.felix.bundlerepository.Resource;
 
-public class CapabilityImpl implements Capability
+
+public class ResourceCapabilityImpl implements ResourceCapability
 {
-    private ResourceImpl m_resource;
-    private String m_name = null;
-    private final Map m_map = new HashMap();
+    private final Resource resource;
+    private final Capability capability;
 
-    public CapabilityImpl()
+    public ResourceCapabilityImpl(Resource resource, Capability capability)
     {
+        this.resource = resource;
+        this.capability = capability;
     }
 
     public Resource getResource()
     {
-        return m_resource;
-    }
-
-    public void setResource(ResourceImpl resource)
-    {
-        m_resource = resource;
+        return resource;
     }
 
-    public String getName()
+    public Capability getCapability()
     {
-        return m_name;
+        return capability;
     }
 
-    public void setName(String name)
-    {
-        m_name = name.intern();
-    }
-
-    public Map getProperties()
-    {
-        return m_map;
-    }
-
-    protected void addP(PropertyImpl prop)
-    {
-        addP(prop.getN(), prop.getV());
-    }
-
-    protected void addP(String name, Object value)
-    {
-        m_map.put(name.toLowerCase(), value);
-    }
-
-    public String toString()
-    {
-        return m_name  + ":" + m_map.toString();
-    }
-}
\ No newline at end of file
+}

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java Tue Mar  2 09:47:08 2010
@@ -32,7 +32,7 @@
 {
 
     private final Map m_map = new HashMap();
-    private RepositoryImpl m_repo = null;
+    private Repository m_repo;
     private List m_capList = new ArrayList();
     private List m_reqList = new ArrayList();
 
@@ -90,6 +90,14 @@
         return m_hash;
     }
 
+    public Repository getRepository() {
+        return m_repo;
+    }
+
+    public void setRepository(Repository repository) {
+        this.m_repo = repository;
+    }
+
     public Map getProperties()
     {
         if (!m_converted)
@@ -137,7 +145,6 @@
 
     protected void addRequire(Requirement req)
     {
-        ((RequirementImpl) req).setResource(this);
         m_reqList.add(req);
     }
 
@@ -148,7 +155,6 @@
 
     protected void addCapability(Capability cap)
     {
-        ((CapabilityImpl) cap).setResource(this);
         m_capList.add(cap);
     }
 
@@ -173,14 +179,9 @@
         catList.add(cat.getId());
     }
 
-    public Repository getRepository()
+    public boolean isLocal()
     {
-        return m_repo;
-    }
-
-    protected void setRepository(RepositoryImpl repo)
-    {
-        m_repo = repo;
+        return false;
     }
 
     /**
@@ -207,7 +208,7 @@
         {
             m_sourceURI = (String) value;
         }
-        else if (key.equals(JAVADOC))
+        else if (key.equals(JAVADOC_URL))
         {
             m_javadocURI = (String) value;
         }
@@ -268,7 +269,7 @@
                 }
                 if (m_javadocURI != null)
                 {
-                    m_map.put(JAVADOC, new URL(base, m_javadocURI));
+                    m_map.put(JAVADOC_URL, new URL(base, m_javadocURI));
                 }
                 m_converted = true;
             }

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SystemRepositoryImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SystemRepositoryImpl.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SystemRepositoryImpl.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SystemRepositoryImpl.java Tue Mar  2 09:47:08 2010
@@ -69,9 +69,4 @@
         return lastModified;
     }
 
-    public boolean isLocal()
-    {
-        return true;
-    }
-
 }
\ No newline at end of file

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java Tue Mar  2 09:47:08 2010
@@ -1,3 +1,21 @@
+/*
+ * 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.bundlerepository.impl.wrapper;
 
 import java.util.Map;

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java Tue Mar  2 09:47:08 2010
@@ -1,8 +1,27 @@
+/*
+ * 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.bundlerepository.impl.wrapper;
 
 import java.net.URL;
 
 import org.apache.felix.bundlerepository.RepositoryAdmin;
+import org.osgi.framework.InvalidSyntaxException;
 
 public class RepositoryAdminWrapper implements org.osgi.service.obr.RepositoryAdmin
 {
@@ -15,7 +34,11 @@
     }
 
     public org.osgi.service.obr.Resource[] discoverResources(String filterExpr) {
-        return Wrapper.wrap(admin.discoverResources(filterExpr));
+        try {
+            return Wrapper.wrap(admin.discoverResources(filterExpr));
+        } catch (InvalidSyntaxException e) {
+            throw new RuntimeException(e);
+        }
     }
 
     public org.osgi.service.obr.Resolver resolver() {

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java Tue Mar  2 09:47:08 2010
@@ -1,17 +1,27 @@
+/*
+ * 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.bundlerepository.impl.wrapper;
 
 import java.net.URL;
 
 import org.apache.felix.bundlerepository.Repository;
-import org.apache.felix.bundlerepository.Resource;
 
-/**
- * Created by IntelliJ IDEA.
- * User: gnodet
- * Date: Feb 25, 2010
- * Time: 11:50:21 PM
- * To change this template use File | Settings | File Templates.
- */
 public class RepositoryWrapper implements org.osgi.service.obr.Repository {
 
     private final Repository repository;

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java Tue Mar  2 09:47:08 2010
@@ -1,15 +1,25 @@
+/*
+ * 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.bundlerepository.impl.wrapper;
 
-import org.apache.felix.bundlerepository.Capability;
 import org.apache.felix.bundlerepository.Requirement;
 
-/**
- * Created by IntelliJ IDEA.
- * User: gnodet
- * Date: Feb 25, 2010
- * Time: 11:47:36 PM
- * To change this template use File | Settings | File Templates.
- */
 public class RequirementWrapper implements org.osgi.service.obr.Requirement {
 
     final Requirement requirement;
@@ -45,4 +55,19 @@
     public boolean isSatisfied(org.osgi.service.obr.Capability capability) {
         return requirement.isSatisfied(Wrapper.unwrap(capability));
     }
+
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        RequirementWrapper that = (RequirementWrapper) o;
+
+        if (requirement != null ? !requirement.equals(that.requirement) : that.requirement != null) return false;
+
+        return true;
+    }
+
+    public int hashCode() {
+        return requirement != null ? requirement.hashCode() : 0;
+    }
 }

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java Tue Mar  2 09:47:08 2010
@@ -1,16 +1,32 @@
+/*
+ * 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.bundlerepository.impl.wrapper;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.felix.bundlerepository.Reason;
 import org.apache.felix.bundlerepository.Requirement;
 import org.apache.felix.bundlerepository.Resolver;
-import org.apache.felix.bundlerepository.Resource;
 
-/**
- * Created by IntelliJ IDEA.
- * User: gnodet
- * Date: Feb 25, 2010
- * Time: 11:52:08 PM
- * To change this template use File | Settings | File Templates.
- */
 public class ResolverWrapper implements org.osgi.service.obr.Resolver {
 
     private final Resolver resolver;
@@ -28,8 +44,8 @@
         return Wrapper.wrap(resolver.getAddedResources());
     }
 
-    public org.osgi.service.obr.Requirement[] getUnsatisfiedRequirements() {
-        return Wrapper.wrap(resolver.getUnsatisfiedRequirements());
+    public org.osgi.service.obr.Resource[] getRequiredResources() {
+        return Wrapper.wrap(resolver.getRequiredResources());
     }
 
     public org.osgi.service.obr.Resource[] getOptionalResources() {
@@ -37,15 +53,32 @@
     }
 
     public org.osgi.service.obr.Requirement[] getReason(org.osgi.service.obr.Resource resource) {
-        return Wrapper.wrap(resolver.getReason(Wrapper.unwrap(resource)));
+        Reason[] r = resolver.getReason(Wrapper.unwrap(resource));
+        if (r == null)
+        {
+            return null;
+        }
+        Requirement[] r2 = new Requirement[r.length];
+        for (int reaIdx = 0; reaIdx < r.length; reaIdx++)
+        {
+            r2[reaIdx] = r[reaIdx].getRequirement();
+        }
+        return Wrapper.wrap(r2);
     }
 
-    public org.osgi.service.obr.Resource[] getResources(org.osgi.service.obr.Requirement requirement) {
-        return Wrapper.wrap(resolver.getResources(Wrapper.unwrap(requirement)));
+    public org.osgi.service.obr.Requirement[] getUnsatisfiedRequirements() {
+        Map map = getUnsatisfiedRequirementsMap();
+        return (org.osgi.service.obr.Requirement[]) map.keySet().toArray(new org.osgi.service.obr.Requirement[map.size()]);
     }
 
-    public org.osgi.service.obr.Resource[] getRequiredResources() {
-        return Wrapper.wrap(resolver.getRequiredResources());
+    public org.osgi.service.obr.Resource[] getResources(org.osgi.service.obr.Requirement requirement) {
+        Map map = getUnsatisfiedRequirementsMap();
+        List l = (List) map.get(requirement);
+        if (l == null)
+        {
+            return null;
+        }
+        return (org.osgi.service.obr.Resource[]) l.toArray(new org.osgi.service.obr.Resource[l.size()]);
     }
 
     public boolean resolve() {
@@ -53,6 +86,24 @@
     }
 
     public void deploy(boolean start) {
-        resolver.deploy(start);
+        resolver.deploy(start ? Resolver.START : 0);
+    }
+
+    private Map getUnsatisfiedRequirementsMap() {
+        Reason[] reasons = resolver.getUnsatisfiedRequirements();
+        Map map = new HashMap();
+        for (int i = 0; i < reasons.length; i++)
+        {
+            org.osgi.service.obr.Requirement req = Wrapper.wrap(reasons[i].getRequirement());
+            org.osgi.service.obr.Resource res = Wrapper.wrap(reasons[i].getResource());
+            List l = (List) map.get(req);
+            if (l == null)
+            {
+                l = new ArrayList();
+                map.put(req, l);
+            }
+            l.add(res);
+        }
+        return map;
     }
 }

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java Tue Mar  2 09:47:08 2010
@@ -1,3 +1,21 @@
+/*
+ * 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.bundlerepository.impl.wrapper;
 
 import java.net.URL;
@@ -54,6 +72,6 @@
     }
 
     public Repository getRepository() {
-        return Wrapper.wrap(resource.getRepository());
+        throw new UnsupportedOperationException();
     }
 }

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java (original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java Tue Mar  2 09:47:08 2010
@@ -1,3 +1,21 @@
+/*
+ * 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.bundlerepository.impl.wrapper;
 
 import org.apache.felix.bundlerepository.Capability;

Modified: felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java?rev=917934&r1=917933&r2=917934&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java (original)
+++ felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java Tue Mar  2 09:47:08 2010
@@ -57,11 +57,11 @@
 
         // first resource is from the referral1_repository.xml
         assertEquals("6", res[0].getId());
-        assertEquals("referral1_repository", res[0].getRepository().getName());
+//        assertEquals("referral1_repository", res[0].getRepository().getName());
 
         // second resource is from the referred.xml
         assertEquals("99", res[1].getId());
-        assertEquals("referred", res[1].getRepository().getName());
+//        assertEquals("referred", res[1].getRepository().getName());
     }
 
     public void testReferral2() throws Exception
@@ -86,7 +86,7 @@
 
         // first resource is from the referral1_repository.xml
         assertEquals("6", res[0].getId());
-        assertEquals("referral1_repository", res[0].getRepository().getName());
+//        assertEquals("referral1_repository", res[0].getRepository().getName());
     }
 
     private RepositoryAdminImpl createRepositoryAdmin() throws Exception



Mime
View raw message