felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r916503 [2/2] - in /felix/trunk/bundlerepository: ./ src/main/java/org/apache/felix/bundlerepository/ src/main/java/org/apache/felix/bundlerepository/impl/ src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ src/main/java/o...
Date Fri, 26 Feb 2010 00:14:53 GMT
Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Util.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Util.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Util.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Util.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Util.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Util.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Util.java
Fri Feb 26 00:14:51 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
 
 import java.io.*;
 import java.util.ArrayList;

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/VersionRange.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/VersionRange.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/VersionRange.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/VersionRange.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/VersionRange.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/VersionRange.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/VersionRange.java
Fri Feb 26 00:14:51 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
 
 import org.osgi.framework.Version;
 

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ClassUtility.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ClassUtility.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ClassUtility.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ClassUtility.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ClassUtility.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ClassUtility.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ClassUtility.java
Fri Feb 26 00:14:51 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository.metadataparser;
+package org.apache.felix.bundlerepository.impl.metadataparser;
 
 /**
  * This class provides methods to process class name

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/KXml2MetadataHandler.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/KXml2MetadataHandler.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/KXml2MetadataHandler.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/KXml2MetadataHandler.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/KXml2MetadataHandler.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/KXml2MetadataHandler.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/KXml2MetadataHandler.java
Fri Feb 26 00:14:51 2010
@@ -16,12 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository.metadataparser;
+package org.apache.felix.bundlerepository.impl.metadataparser;
 
 import java.io.*;
 
-import org.apache.felix.bundlerepository.metadataparser.kxmlsax.KXml2SAXParser;
-import org.apache.felix.bundlerepository.Logger;
+import org.apache.felix.bundlerepository.impl.Logger;
+import org.apache.felix.bundlerepository.impl.metadataparser.kxmlsax.KXml2SAXParser;
 
 /**
  * handles the metadata in XML format

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MappingProcessingInstructionHandler.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MappingProcessingInstructionHandler.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MappingProcessingInstructionHandler.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MappingProcessingInstructionHandler.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MappingProcessingInstructionHandler.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MappingProcessingInstructionHandler.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MappingProcessingInstructionHandler.java
Fri Feb 26 00:14:51 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository.metadataparser;
+package org.apache.felix.bundlerepository.impl.metadataparser;
 
 /**
  * this class adds type of elements to the parser

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MetadataHandler.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MetadataHandler.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MetadataHandler.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MetadataHandler.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MetadataHandler.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MetadataHandler.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MetadataHandler.java
Fri Feb 26 00:14:51 2010
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository.metadataparser;
+package org.apache.felix.bundlerepository.impl.metadataparser;
 
-import org.apache.felix.bundlerepository.Logger;
+import org.apache.felix.bundlerepository.impl.Logger;
 
 import java.io.InputStream;
 import java.lang.reflect.Method;

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ReplaceUtility.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ReplaceUtility.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ReplaceUtility.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ReplaceUtility.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ReplaceUtility.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ReplaceUtility.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ReplaceUtility.java
Fri Feb 26 00:14:51 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository.metadataparser;
+package org.apache.felix.bundlerepository.impl.metadataparser;
 
 import java.util.Map;
 

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlCommonHandler.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlCommonHandler.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlCommonHandler.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlCommonHandler.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlCommonHandler.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlCommonHandler.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlCommonHandler.java
Fri Feb 26 00:14:51 2010
@@ -16,14 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository.metadataparser;
+package org.apache.felix.bundlerepository.impl.metadataparser;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.*;
 
-import org.apache.felix.bundlerepository.metadataparser.kxmlsax.KXml2SAXHandler;
-import org.apache.felix.bundlerepository.Logger;
+import org.apache.felix.bundlerepository.impl.Logger;
+import org.apache.felix.bundlerepository.impl.metadataparser.kxmlsax.KXml2SAXHandler;
 import org.xml.sax.SAXException;
 
 /**

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlMetadataHandler.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlMetadataHandler.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlMetadataHandler.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlMetadataHandler.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlMetadataHandler.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlMetadataHandler.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlMetadataHandler.java
Fri Feb 26 00:14:51 2010
@@ -16,15 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository.metadataparser;
+package org.apache.felix.bundlerepository.impl.metadataparser;
 
 import java.io.IOException;
 import java.io.InputStream;
 
 import javax.xml.parsers.*;
 
+import org.apache.felix.bundlerepository.impl.Logger;
 import org.xml.sax.*;
-import org.apache.felix.bundlerepository.Logger;
 
 /**
  * handles the metadata in XML format

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXHandler.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXHandler.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXHandler.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXHandler.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXHandler.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXHandler.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXHandler.java
Fri Feb 26 00:14:51 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository.metadataparser.kxmlsax;
+package org.apache.felix.bundlerepository.impl.metadataparser.kxmlsax;
 
 import java.util.Properties;
 

Copied: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXParser.java
(from r916502, felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXParser.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXParser.java?p2=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXParser.java&p1=felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXParser.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXParser.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXParser.java
Fri Feb 26 00:14:51 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository.metadataparser.kxmlsax;
+package org.apache.felix.bundlerepository.impl.metadataparser.kxmlsax;
 
 import java.io.Reader;
 import java.util.Properties;

Added: 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=916503&view=auto
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java
(added)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java
Fri Feb 26 00:14:51 2010
@@ -0,0 +1,23 @@
+package org.apache.felix.bundlerepository.impl.wrapper;
+
+import java.util.Map;
+
+import org.apache.felix.bundlerepository.Capability;
+
+public class CapabilityWrapper implements org.osgi.service.obr.Capability {
+
+    final Capability capability;
+
+    public CapabilityWrapper(Capability capability)
+    {
+        this.capability = capability;
+    }
+
+    public String getName() {
+        return capability.getName();
+    }
+
+    public Map getProperties() {
+        return capability.getProperties();
+    }
+}

Added: 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=916503&view=auto
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java
(added)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java
Fri Feb 26 00:14:51 2010
@@ -0,0 +1,41 @@
+package org.apache.felix.bundlerepository.impl.wrapper;
+
+import java.net.URL;
+
+import org.apache.felix.bundlerepository.RepositoryAdmin;
+
+public class RepositoryAdminWrapper implements org.osgi.service.obr.RepositoryAdmin
+{
+
+    private final RepositoryAdmin admin;
+
+    public RepositoryAdminWrapper(RepositoryAdmin admin) 
+    {
+        this.admin = admin;
+    }
+
+    public org.osgi.service.obr.Resource[] discoverResources(String filterExpr) {
+        return Wrapper.wrap(admin.discoverResources(filterExpr));
+    }
+
+    public org.osgi.service.obr.Resolver resolver() {
+        return Wrapper.wrap(admin.resolver());
+    }
+
+    public org.osgi.service.obr.Repository addRepository(URL repository) throws Exception
{
+        return Wrapper.wrap(admin.addRepository(repository));
+    }
+
+    public boolean removeRepository(URL repository) {
+        return admin.removeRepository(repository);
+    }
+
+    public org.osgi.service.obr.Repository[] listRepositories() {
+        return Wrapper.wrap(admin.listRepositories());
+    }
+
+    public org.osgi.service.obr.Resource getResource(String s) {
+        throw new UnsupportedOperationException();
+    }
+
+}

Added: 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=916503&view=auto
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java
(added)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java
Fri Feb 26 00:14:51 2010
@@ -0,0 +1,40 @@
+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;
+
+    public RepositoryWrapper(Repository repository)
+    {
+        this.repository = repository;
+    }
+
+    public URL getURL() {
+        return repository.getURL();
+    }
+
+    public org.osgi.service.obr.Resource[] getResources() {
+        return Wrapper.wrap(repository.getResources());
+    }
+
+    public String getName() {
+        return repository.getName();
+    }
+
+    public long getLastModified() {
+        return repository.getLastModified();
+    }
+
+}

Added: 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=916503&view=auto
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java
(added)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java
Fri Feb 26 00:14:51 2010
@@ -0,0 +1,48 @@
+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;
+
+    public RequirementWrapper(Requirement requirement) {
+        this.requirement = requirement;
+    }
+
+    public String getName() {
+        return requirement.getName();
+    }
+
+    public String getFilter() {
+        return requirement.getFilter();
+    }
+
+    public boolean isMultiple() {
+        return requirement.isMultiple();
+    }
+
+    public boolean isOptional() {
+        return requirement.isOptional();
+    }
+
+    public boolean isExtend() {
+        return requirement.isExtend();
+    }
+
+    public String getComment() {
+        return requirement.getComment();
+    }
+
+    public boolean isSatisfied(org.osgi.service.obr.Capability capability) {
+        return requirement.isSatisfied(Wrapper.unwrap(capability));
+    }
+}

Added: 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=916503&view=auto
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java
(added)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java
Fri Feb 26 00:14:51 2010
@@ -0,0 +1,58 @@
+package org.apache.felix.bundlerepository.impl.wrapper;
+
+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;
+
+    public ResolverWrapper(Resolver resolver)
+    {
+        this.resolver = resolver;
+    }
+
+    public void add(org.osgi.service.obr.Resource resource) {
+        resolver.add(Wrapper.unwrap(resource));
+    }
+
+    public org.osgi.service.obr.Resource[] getAddedResources() {
+        return Wrapper.wrap(resolver.getAddedResources());
+    }
+
+    public org.osgi.service.obr.Requirement[] getUnsatisfiedRequirements() {
+        return Wrapper.wrap(resolver.getUnsatisfiedRequirements());
+    }
+
+    public org.osgi.service.obr.Resource[] getOptionalResources() {
+        return Wrapper.wrap(resolver.getOptionalResources());
+    }
+
+    public org.osgi.service.obr.Requirement[] getReason(org.osgi.service.obr.Resource resource)
{
+        return Wrapper.wrap(resolver.getReason(Wrapper.unwrap(resource)));
+    }
+
+    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.Resource[] getRequiredResources() {
+        return Wrapper.wrap(resolver.getRequiredResources());
+    }
+
+    public boolean resolve() {
+        return resolver.resolve();
+    }
+
+    public void deploy(boolean start) {
+        resolver.deploy(start);
+    }
+}

Added: 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=916503&view=auto
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java
(added)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java
Fri Feb 26 00:14:51 2010
@@ -0,0 +1,59 @@
+package org.apache.felix.bundlerepository.impl.wrapper;
+
+import java.net.URL;
+import java.util.Map;
+
+import org.apache.felix.bundlerepository.Resource;
+import org.osgi.framework.Version;
+import org.osgi.service.obr.Capability;
+import org.osgi.service.obr.Repository;
+import org.osgi.service.obr.Requirement;
+
+public class ResourceWrapper implements org.osgi.service.obr.Resource {
+
+    final Resource resource;
+
+    public ResourceWrapper(Resource resource) {
+        this.resource = resource;
+    }
+
+    public Map getProperties() {
+        return resource.getProperties();
+    }
+
+    public String getSymbolicName() {
+        return resource.getSymbolicName();
+    }
+
+    public String getPresentationName() {
+        return resource.getPresentationName();
+    }
+
+    public Version getVersion() {
+        return resource.getVersion();
+    }
+
+    public String getId() {
+        return resource.getId();
+    }
+
+    public URL getURL() {
+        return resource.getURL();
+    }
+
+    public Requirement[] getRequirements() {
+        return Wrapper.wrap(resource.getRequirements());
+    }
+
+    public Capability[] getCapabilities() {
+        return Wrapper.wrap(resource.getCapabilities());
+    }
+
+    public String[] getCategories() {
+        return resource.getCategories();
+    }
+
+    public Repository getRepository() {
+        return Wrapper.wrap(resource.getRepository());
+    }
+}

Added: 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=916503&view=auto
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java
(added)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java
Fri Feb 26 00:14:51 2010
@@ -0,0 +1,88 @@
+package org.apache.felix.bundlerepository.impl.wrapper;
+
+import org.apache.felix.bundlerepository.Capability;
+import org.apache.felix.bundlerepository.Repository;
+import org.apache.felix.bundlerepository.RepositoryAdmin;
+import org.apache.felix.bundlerepository.Requirement;
+import org.apache.felix.bundlerepository.Resolver;
+import org.apache.felix.bundlerepository.Resource;
+
+public class Wrapper {
+
+    public static org.osgi.service.obr.RepositoryAdmin wrap(RepositoryAdmin admin) {
+        return new RepositoryAdminWrapper(admin);
+    }
+
+    public static org.osgi.service.obr.Resource wrap(Resource resource) {
+        return new ResourceWrapper(resource);
+    }
+
+    public static org.osgi.service.obr.Repository wrap(Repository repository) {
+        return new RepositoryWrapper(repository);
+    }
+
+    public static org.osgi.service.obr.Resolver wrap(Resolver resolver) {
+        return new ResolverWrapper(resolver);
+    }
+
+    public static org.osgi.service.obr.Requirement wrap(Requirement resolver) {
+        return new RequirementWrapper(resolver);
+    }
+
+    public static org.osgi.service.obr.Capability wrap(Capability capability) {
+        return new CapabilityWrapper(capability);
+    }
+
+    public static Capability unwrap(org.osgi.service.obr.Capability capability) {
+        return ((CapabilityWrapper) capability).capability;
+    }
+
+    public static Resource unwrap(org.osgi.service.obr.Resource resource) {
+        return ((ResourceWrapper) resource).resource;
+    }
+
+    public static Requirement unwrap(org.osgi.service.obr.Requirement requirement) {
+        return ((RequirementWrapper) requirement).requirement;
+    }
+
+    public static org.osgi.service.obr.Resource[] wrap(Resource[] resources)
+    {
+        org.osgi.service.obr.Resource[] res = new org.osgi.service.obr.Resource[resources.length];
+        for (int i = 0; i < resources.length; i++)
+        {
+            res[i] = wrap(resources[i]);
+        }
+        return res;
+    }
+
+    public static org.osgi.service.obr.Repository[] wrap(Repository[] repositories)
+    {
+        org.osgi.service.obr.Repository[] rep = new org.osgi.service.obr.Repository[repositories.length];
+        for (int i = 0; i < repositories.length; i++)
+        {
+            rep[i] = wrap(repositories[i]);
+        }
+        return rep;
+    }
+
+    public static org.osgi.service.obr.Requirement[] wrap(Requirement[] requirements)
+    {
+        org.osgi.service.obr.Requirement[] req = new org.osgi.service.obr.Requirement[requirements.length];
+        for (int i = 0; i < requirements.length; i++)
+        {
+            req[i] = wrap(requirements[i]);
+        }
+        return req;
+    }
+
+    public static org.osgi.service.obr.Capability[] wrap(Capability[] capabilities)
+    {
+        org.osgi.service.obr.Capability[] cap = new org.osgi.service.obr.Capability[capabilities.length];
+        for (int i = 0; i < capabilities.length; i++)
+        {
+            cap[i] = wrap(capabilities[i]);
+        }
+        return cap;
+    }
+
+}

Copied: felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/FilterImplTest.java
(from r916502, felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/FilterImplTest.java?p2=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/FilterImplTest.java&p1=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java
(original)
+++ felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/FilterImplTest.java
Fri Feb 26 00:14:51 2010
@@ -16,12 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
 
 import java.util.Dictionary;
 import java.util.Hashtable;
 
 import junit.framework.TestCase;
+import org.apache.felix.bundlerepository.impl.FilterImpl;
 import org.osgi.framework.Version;
 
 public class FilterImplTest extends TestCase

Copied: felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryAdminTest.java
(from r916502, felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryAdminTest.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryAdminTest.java?p2=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryAdminTest.java&p1=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryAdminTest.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryAdminTest.java
(original)
+++ felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryAdminTest.java
Fri Feb 26 00:14:51 2010
@@ -16,12 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
 
 import java.net.URL;
 import java.util.Hashtable;
 
 import junit.framework.TestCase;
+import org.apache.felix.bundlerepository.Resource;
+import org.apache.felix.bundlerepository.impl.FilterImpl;
+import org.apache.felix.bundlerepository.impl.Logger;
+import org.apache.felix.bundlerepository.impl.RepositoryAdminImpl;
+import org.apache.felix.bundlerepository.impl.RepositoryImpl;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.IAnswer;
@@ -30,8 +35,6 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleListener;
 import org.osgi.framework.ServiceListener;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.Resource;
 
 public class RepositoryAdminTest extends TestCase
 {
@@ -76,7 +79,7 @@
         RepositoryAdminImpl repoAdmin = new RepositoryAdminImpl(bundleContext, new Logger(bundleContext));
 
         // force initialization && remove all initial repositories
-        Repository[] repos = repoAdmin.listRepositories();
+        org.apache.felix.bundlerepository.Repository[] repos = repoAdmin.listRepositories();
         for (int i = 0; repos != null && i < repos.length; i++)
         {
             repoAdmin.removeRepository(repos[i].getURL());

Copied: felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java
(from r916502, felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryImplTest.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java?p2=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java&p1=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryImplTest.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryImplTest.java
(original)
+++ felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java
Fri Feb 26 00:14:51 2010
@@ -16,13 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
 
 import java.net.URL;
 import java.util.Dictionary;
 import java.util.Hashtable;
 
 import junit.framework.TestCase;
+import org.apache.felix.bundlerepository.Repository;
+import org.apache.felix.bundlerepository.Resource;
 import org.easymock.EasyMock;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -30,8 +32,6 @@
 import org.osgi.framework.Filter;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.Resource;
 
 public class RepositoryImplTest extends TestCase
 {

Copied: felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/ResolverImplTest.java
(from r916502, felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/ResolverImplTest.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/ResolverImplTest.java?p2=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/ResolverImplTest.java&p1=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/ResolverImplTest.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/ResolverImplTest.java
(original)
+++ felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/ResolverImplTest.java
Fri Feb 26 00:14:51 2010
@@ -16,13 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
 
 import java.net.URL;
 import java.util.Hashtable;
 
 import junit.framework.TestCase;
 
+import org.apache.felix.bundlerepository.Requirement;
+import org.apache.felix.bundlerepository.Resource;
+import org.apache.felix.bundlerepository.impl.FilterImpl;
+import org.apache.felix.bundlerepository.impl.Logger;
+import org.apache.felix.bundlerepository.impl.RepositoryAdminImpl;
+import org.apache.felix.bundlerepository.impl.RepositoryImpl;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.IAnswer;
@@ -31,11 +37,8 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleListener;
 import org.osgi.framework.ServiceListener;
-import org.osgi.service.obr.InterruptedResolutionException;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.Requirement;
-import org.osgi.service.obr.Resolver;
-import org.osgi.service.obr.Resource;
+import org.apache.felix.bundlerepository.Repository;
+import org.apache.felix.bundlerepository.Resolver;
 
 public class ResolverImplTest extends TestCase
 {
@@ -92,7 +95,7 @@
             resolver.resolve();
             fail("An excepiton should have been thrown");
         }
-        catch (InterruptedResolutionException e)
+        catch (org.apache.felix.bundlerepository.InterruptedResolutionException e)
         {
             // ok
         }

Copied: felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/StaxParserTest.java
(from r916502, felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/StaxParserTest.java)
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/StaxParserTest.java?p2=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/StaxParserTest.java&p1=felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/StaxParserTest.java&r1=916502&r2=916503&rev=916503&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/StaxParserTest.java
(original)
+++ felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/StaxParserTest.java
Fri Feb 26 00:14:51 2010
@@ -16,12 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
 
 import java.net.URL;
 import java.util.Hashtable;
 
 import junit.framework.TestCase;
+import org.apache.felix.bundlerepository.Resolver;
+import org.apache.felix.bundlerepository.Resource;
+import org.apache.felix.bundlerepository.impl.FilterImpl;
+import org.apache.felix.bundlerepository.impl.Logger;
+import org.apache.felix.bundlerepository.impl.RepositoryAdminImpl;
+import org.apache.felix.bundlerepository.impl.RepositoryImpl;
+import org.apache.felix.bundlerepository.impl.StaxParser;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.IAnswer;
@@ -30,9 +37,7 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleListener;
 import org.osgi.framework.ServiceListener;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.Resolver;
-import org.osgi.service.obr.Resource;
+import org.apache.felix.bundlerepository.Repository;
 
 public class StaxParserTest extends TestCase
 {



Mime
View raw message