FELIX-2139: Change the pacakge name of the api to better control it
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@916503 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundlerepository/obr.xml b/bundlerepository/obr.xml
index b13ed48..9056eda 100644
--- a/bundlerepository/obr.xml
+++ b/bundlerepository/obr.xml
@@ -20,7 +20,10 @@
<capability name="service">
<p n="service" v="org.apache.felix.shell.Command"/>
</capability>
- <capability name="service">
- <p n="service" v="org.osgi.service.obr.RepositoryAdmin"/>
- </capability>
+ <capability name="service">
+ <p n="service" v="org.osgi.service.obr.RepositoryAdmin"/>
+ </capability>
+ <capability name="service">
+ <p n="service" v="org.apache.felix.bundlerepository.RepositoryAdmin"/>
+ </capability>
</obr>
diff --git a/bundlerepository/pom.xml b/bundlerepository/pom.xml
index 5f41be9..4ff03e6 100644
--- a/bundlerepository/pom.xml
+++ b/bundlerepository/pom.xml
@@ -33,7 +33,7 @@
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>org.osgi.service.obr</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.0.1</version>
<optional>true</optional>
</dependency>
<dependency>
@@ -76,21 +76,22 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>1.4.3</version>
+ <version>2.0.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
- <Export-Package>org.osgi.service.obr</Export-Package>
- <Private-Package>org.kxml2.*,org.xmlpull.*;-split-package:=merge-first,org.apache.felix.bundlerepository.*</Private-Package>
- <Import-Package>!javax.xml.parsers,!org.xml.sax,org.osgi.service.log; version="1.3.0"; resolution:=optional,javax.xml.stream;resolution:=optional,*</Import-Package>
+ <Export-Package>org.apache.felix.bundlerepository;version="2.0"</Export-Package>
+ <Private-Package>org.kxml2.*,org.xmlpull.*;-split-package:=merge-first,org.apache.felix.bundlerepository.impl.*</Private-Package>
+ <Import-Package>!javax.xml.parsers,!org.xml.sax,org.osgi.service.log;resolution:=optional,org.osgi.service.obr;resolution:=optional,javax.xml.stream;resolution:=optional,*</Import-Package>
<DynamicImport-Package>org.apache.felix.shell</DynamicImport-Package>
- <Bundle-Activator>${pom.artifactId}.Activator</Bundle-Activator>
+ <Bundle-Activator>${pom.artifactId}.impl.Activator</Bundle-Activator>
<Bundle-DocURL>http://felix.apache.org/site/apache-felix-osgi-bundle-repository.html</Bundle-DocURL>
<Bundle-Url>http://felix.apache.org/site/downloads.cgi</Bundle-Url>
<Bundle-Source>http://felix.apache.org/site/downloads.cgi</Bundle-Source>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
- <Export-Service>org.osgi.service.obr.RepositoryAdmin</Export-Service>
+ <Export-Service>org.apache.felix.bundlerepository.RepositoryAdmin,org.osgi.service.obr.RepositoryAdmin</Export-Service>
+ <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
</instructions>
</configuration>
</plugin>
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Capability.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Capability.java
new file mode 100644
index 0000000..3eede77
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Capability.java
@@ -0,0 +1,48 @@
+/*
+ * $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.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to
+// turn this draft into an official specification.
+package org.apache.felix.bundlerepository;
+
+import java.util.Map;
+
+/**
+ * A named set of properties representing some capability that is provided by
+ * its owner.
+ *
+ * @version $Revision: 1.3 $
+ */
+public interface Capability
+{
+ /**
+ * Return the name of the capability.
+ *
+ */
+ String getName();
+
+ /**
+ * Return the set of properties.
+ *
+ * Notice that the value of the properties is a list of values.
+ *
+ * @return a Map<String,List>
+ */
+ Map getProperties();
+}
\ No newline at end of file
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Attribute.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/InterruptedResolutionException.java
similarity index 65%
copy from bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Attribute.java
copy to bundlerepository/src/main/java/org/apache/felix/bundlerepository/InterruptedResolutionException.java
index 2d20a22..d7b7339 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Attribute.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/InterruptedResolutionException.java
@@ -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,31 +18,28 @@
*/
package org.apache.felix.bundlerepository;
-public class R4Attribute
+/**
+ *
+ * Exception thrown by the resolver if the resolution has been interrupted.
+ */
+public class InterruptedResolutionException extends RuntimeException
{
- private String m_name = "";
- private String m_value = "";
- private boolean m_isMandatory = false;
-
- public R4Attribute(String name, String value, boolean isMandatory)
+ public InterruptedResolutionException()
{
- m_name = name;
- m_value = value;
- m_isMandatory = isMandatory;
}
- public String getName()
+ public InterruptedResolutionException(String message)
{
- return m_name;
+ super(message);
}
- public String getValue()
+ public InterruptedResolutionException(String message, Throwable cause)
{
- return m_value;
+ super(message, cause);
}
- public boolean isMandatory()
+ public InterruptedResolutionException(Throwable cause)
{
- return m_isMandatory;
+ super(cause);
}
}
\ No newline at end of file
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Repository.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Repository.java
new file mode 100644
index 0000000..c47ea95
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Repository.java
@@ -0,0 +1,68 @@
+/*
+ * $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.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to
+// turn this draft into an official specification.
+package org.apache.felix.bundlerepository;
+
+import java.net.URL;
+
+/**
+ * Represents a repository.
+ *
+ * @version $Revision: 1.3 $
+ */
+public interface Repository
+{
+ /**
+ * Return the associated URL for the repository.
+ *
+ */
+ URL getURL();
+
+ /**
+ * Return the resources for this repository.
+ */
+ Resource[] getResources();
+
+ /**
+ * Return the name of this repository.
+ *
+ * @return a non-null name
+ */
+ String getName();
+
+ /**
+ * Return the last modification date of this repository
+ *
+ * @return the last modification date
+ */
+ 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
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdmin.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdmin.java
new file mode 100644
index 0000000..f346be9
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdmin.java
@@ -0,0 +1,167 @@
+/*
+ * $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.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to
+// turn this draft into an official specification.
+package org.apache.felix.bundlerepository;
+
+import java.net.URL;
+
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+
+/**
+ * Provides centralized access to the distributed repository.
+ *
+ * A repository contains a set of <i>resources</i>. A resource contains a
+ * number of fixed attributes (name, version, etc) and sets of:
+ * <ol>
+ * <li>Capabilities - Capabilities provide a named aspect: a bundle, a display,
+ * memory, etc.</li>
+ * <li>Requirements - A named filter expression. The filter must be satisfied
+ * by one or more Capabilities with the given name. These capabilities can come
+ * from other resources or from the platform. If multiple resources provide the
+ * requested capability, one is selected. (### what algorithm? ###)</li>
+ * <li>Requests - Requests are like requirements, except that a request can be
+ * fulfilled by 0..n resources. This feature can be used to link to resources
+ * that are compatible with the given resource and provide extra functionality.
+ * For example, a bundle could request all its known fragments. The UI
+ * associated with the repository could list these as optional downloads.</li>
+ *
+ * @version $Revision: 1.3 $
+ */
+public interface RepositoryAdmin
+{
+ /**
+ * Discover any resources that match the given filter.
+ *
+ * This is not a detailed search, but a first scan of applicable resources.
+ *
+ * ### Checking the capabilities of the filters is not possible because that
+ * requires a new construct in the filter.
+ *
+ * The filter expression can assert any of the main headers of the resource.
+ * The attributes that can be checked are:
+ *
+ * <ol>
+ * <li>name</li>
+ * <li>version (uses filter matching rules)</li>
+ * <li>description</li>
+ * <li>category</li>
+ * <li>copyright</li>
+ * <li>license</li>
+ * <li>source</li>
+ * </ol>
+ *
+ * @param filterExpr
+ * A standard OSGi filter
+ * @return List of resources matching the filters.
+ */
+ Resource[] discoverResources(String filterExpr);
+
+ /**
+ * Discover any resources that match the given requirements.
+ *
+ * @param requirements
+ * @return List of resources matching the filter
+ */
+ Resource[] discoverResources(Requirement[] requirements);
+
+ /**
+ * Create a resolver.
+ *
+ * @return
+ */
+ Resolver resolver();
+
+ /**
+ * Create a resolver on the given repositories.
+ *
+ * @param repositories the list of repositories to use for the resolution
+ * @return
+ */
+ Resolver resolver(Repository[] repositories);
+
+ /**
+ * Add a new repository to the federation.
+ *
+ * The url must point to a repository XML file.
+ *
+ * @param repository
+ * @return
+ * @throws Exception
+ */
+ Repository addRepository(URL repository) throws Exception;
+
+ /**
+ * Remove a repository from the federation
+ *
+ * The url must point to a repository XML file.
+ *
+ * @param repository
+ * @return
+ */
+ boolean removeRepository(URL repository);
+
+ /**
+ * List all the repositories.
+ *
+ * @return
+ */
+ Repository[] listRepositories();
+
+ /**
+ * Return the repository containing the system bundle
+ *
+ * @return
+ */
+ Repository getSystemRepository();
+
+ /**
+ * Return the repository containing locally installed resources
+ *
+ * @return
+ */
+ Repository getLocalRepository();
+
+ /**
+ * Create a simple requirement to be used for selection
+ * @param name
+ * @param filter
+ * @return
+ */
+ Requirement requirement(String name, String filter) throws InvalidSyntaxException;
+
+ /**
+ * Create an extender filter supporting the SUBSET, SUPERSET and other extensions
+ *
+ * @param filter the string filter
+ * @return
+ */
+ Filter filter(String filter) throws InvalidSyntaxException;
+
+ /**
+ * Create a repository from the specified URL.
+ *
+ * @param repository
+ * @return
+ */
+ Repository repository(URL repository) throws Exception;
+
+}
\ No newline at end of file
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Requirement.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Requirement.java
new file mode 100644
index 0000000..3112428
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Requirement.java
@@ -0,0 +1,53 @@
+/*
+ * $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.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to
+// turn this draft into an official specification.
+package org.apache.felix.bundlerepository;
+
+/**
+ * A named requirement specifies the need for certain capabilities with the same
+ * name.
+ *
+ * @version $Revision: 1.4 $
+ */
+public interface Requirement
+{
+
+ /**
+ * Return the name of the requirement.
+ */
+ String getName();
+
+ /**
+ * Return the filter.
+ *
+ */
+ String getFilter();
+
+ boolean isMultiple();
+
+ boolean isOptional();
+
+ boolean isExtend();
+
+ String getComment();
+
+ boolean isSatisfied(Capability capability);
+}
\ No newline at end of file
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resolver.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resolver.java
new file mode 100644
index 0000000..2f0cae8
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resolver.java
@@ -0,0 +1,85 @@
+/*
+ * $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.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to
+// turn this draft into an official specification.
+package org.apache.felix.bundlerepository;
+
+public interface Resolver
+{
+
+ /**
+ * Add the following resource to the resolution.
+ *
+ * The resource will be part of the output and all its requirements
+ * will be satisfied.
+ *
+ * It has the same effect has adding a requirement that will match
+ * this resource by symbolicname and version.
+ *
+ * The current resolution will be lost after adding a resource.
+ *
+ * @param resource the resource to add
+ */
+ void add(Resource resource);
+
+ /**
+ * Returns the list of resources that have been added to the resolution
+ * @return
+ */
+ Resource[] getAddedResources();
+
+ /**
+ * Add the following requirement to the resolution
+ *
+ * The current resolution will be lost after adding a requirement.
+ *
+ * @param requirement the requirement to add
+ */
+ void add(Requirement requirement);
+
+ /**
+ * Returns the list of requirements that have been added to the resolution
+ * @return
+ */
+ Requirement[] getAddedRequirements();
+
+ Requirement[] getUnsatisfiedRequirements();
+
+ Resource[] getOptionalResources();
+
+ Requirement[] getReason(Resource resource);
+
+ Resource[] getResources(Requirement requirement);
+
+ Resource[] getRequiredResources();
+
+ /**
+ * Start the resolution process and return whether the constraints have
+ * been successfully met or not.
+ * The resolution can be interrupted by a call to Thread.interrupt() at any
+ * time. The result will be to stop the resolver and throw an InterruptedException.
+ *
+ * @return <code>true</code> if the resolution has succeeded else <code>false</code>
+ * @throws InterruptedResolutionException if the resolution has been interrupted
+ */
+ boolean resolve();
+
+ void deploy(boolean start);
+}
\ No newline at end of file
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resource.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resource.java
new file mode 100644
index 0000000..4e7eede
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resource.java
@@ -0,0 +1,87 @@
+/*
+ * $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.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to
+// turn this draft into an official specification.
+package org.apache.felix.bundlerepository;
+
+import java.net.URL;
+import java.util.Map;
+
+import org.osgi.framework.Version;
+
+/**
+ * A resource is an abstraction of a downloadable thing, like a bundle.
+ *
+ * Resources have capabilities and requirements. All a resource's requirements
+ * must be satisfied before it can be installed.
+ *
+ * @version $Revision: 1.5 $
+ */
+public interface Resource
+{
+ final String LICENSE_URL = "license";
+
+ final String DESCRIPTION = "description";
+
+ final String DOCUMENTATION_URL = "documentation";
+
+ final String COPYRIGHT = "copyright";
+
+ final String SOURCE_URL = "source";
+
+ final String SYMBOLIC_NAME = "symbolicname";
+
+ final String PRESENTATION_NAME = "presentationname";
+
+ final String ID = "id";
+
+ final String VERSION = "version";
+
+ final String URI = "uri";
+
+ final String SIZE = "size";
+
+ final String CATEGORY = "category";
+
+ final String JAVADOC = "javadoc";
+
+ // get readable name
+
+ Map getProperties();
+
+ String getSymbolicName();
+
+ String getPresentationName();
+
+ Version getVersion();
+
+ String getId();
+
+ URL getURL();
+
+ Requirement[] getRequirements();
+
+ Capability[] getCapabilities();
+
+ String[] getCategories();
+
+ Repository getRepository();
+
+}
\ No newline at end of file
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Activator.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Activator.java
similarity index 85%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/Activator.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Activator.java
index 92b0705..1d5b0cb 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Activator.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Activator.java
@@ -16,13 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
import java.util.Hashtable;
+import org.apache.felix.bundlerepository.impl.wrapper.Wrapper;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
-import org.osgi.service.obr.RepositoryAdmin;
+import org.apache.felix.bundlerepository.RepositoryAdmin;
import org.osgi.service.url.URLConstants;
import org.osgi.service.url.URLStreamHandlerService;
@@ -41,6 +42,17 @@
RepositoryAdmin.class.getName(),
m_repoAdmin, null);
+ try
+ {
+ context.registerService(
+ org.osgi.service.obr.RepositoryAdmin.class.getName(),
+ Wrapper.wrap(m_repoAdmin), null);
+ }
+ catch (Throwable th)
+ {
+ // Ignore
+ }
+
// We dynamically import the impl service API, so it
// might not actually be available, so be ready to catch
// the exception when we try to register the command service.
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/CapabilityImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java
similarity index 87%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/CapabilityImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java
index 2c387c1..9302195 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/CapabilityImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CapabilityImpl.java
@@ -16,16 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
import java.util.*;
-import org.osgi.service.obr.Capability;
-import org.osgi.service.obr.Resource;
+import org.apache.felix.bundlerepository.Capability;
public class CapabilityImpl implements Capability
{
- private Resource m_resource;
+ private ResourceImpl m_resource;
private String m_name = null;
private final Map m_map = new HashMap();
@@ -33,12 +32,12 @@
{
}
- public Resource getResource()
+ public ResourceImpl getResource()
{
return m_resource;
}
- public void setResource(Resource resource)
+ public void setResource(ResourceImpl resource)
{
m_resource = resource;
}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/CategoryImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CategoryImpl.java
similarity index 95%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/CategoryImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CategoryImpl.java
index f5de01d..84c4eba 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/CategoryImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/CategoryImpl.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
public class CategoryImpl
{
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/FileUtil.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/FileUtil.java
similarity index 98%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/FileUtil.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/FileUtil.java
index 65a773b..e0cc607 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/FileUtil.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/FileUtil.java
@@ -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.net.URL;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/FilterImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/FilterImpl.java
similarity index 99%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/FilterImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/FilterImpl.java
index b1b52e4..2dadb0c 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/FilterImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/FilterImpl.java
@@ -31,7 +31,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/IteratorToEnumeration.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/IteratorToEnumeration.java
similarity index 96%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/IteratorToEnumeration.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/IteratorToEnumeration.java
index 885a115..120c115 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/IteratorToEnumeration.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/IteratorToEnumeration.java
@@ -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.util.Enumeration;
import java.util.Iterator;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java
similarity index 97%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java
index 093cdca..e28a874 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalRepositoryImpl.java
@@ -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.net.URL;
import java.util.HashMap;
@@ -29,8 +29,7 @@
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceEvent;
import org.osgi.framework.SynchronousBundleListener;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.Resource;
+import org.apache.felix.bundlerepository.*;
public class LocalRepositoryImpl implements Repository, SynchronousBundleListener, AllServiceListener
{
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalResourceImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalResourceImpl.java
similarity index 93%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalResourceImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalResourceImpl.java
index dd30923..0690d44 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalResourceImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/LocalResourceImpl.java
@@ -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.util.ArrayList;
import java.util.Dictionary;
@@ -31,7 +31,6 @@
import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.obr.Resource;
public class LocalResourceImpl extends ResourceImpl
{
@@ -160,35 +159,35 @@
if (index != -1) {
sn = sn.substring(0, index);
}
- put(Resource.SYMBOLIC_NAME, sn);
+ put(SYMBOLIC_NAME, sn);
}
else if (key.equalsIgnoreCase(Constants.BUNDLE_NAME))
{
- put(Resource.PRESENTATION_NAME, (String) dict.get(key));
+ put(PRESENTATION_NAME, (String) dict.get(key));
}
else if (key.equalsIgnoreCase(Constants.BUNDLE_VERSION))
{
- put(Resource.VERSION, (String) dict.get(key));
+ put(VERSION, (String) dict.get(key));
}
else if (key.equalsIgnoreCase("Bundle-Source"))
{
- put(Resource.SOURCE_URL, (String) dict.get(key));
+ put(SOURCE_URL, (String) dict.get(key));
}
else if (key.equalsIgnoreCase(Constants.BUNDLE_DESCRIPTION))
{
- put(Resource.DESCRIPTION, (String) dict.get(key));
+ put(DESCRIPTION, (String) dict.get(key));
}
else if (key.equalsIgnoreCase(Constants.BUNDLE_DOCURL))
{
- put(Resource.DOCUMENTATION_URL, (String) dict.get(key));
+ put(DOCUMENTATION_URL, (String) dict.get(key));
}
else if (key.equalsIgnoreCase(Constants.BUNDLE_COPYRIGHT))
{
- put(Resource.COPYRIGHT, (String) dict.get(key));
+ put(COPYRIGHT, (String) dict.get(key));
}
else if (key.equalsIgnoreCase("Bundle-License"))
{
- put(Resource.LICENSE_URL, (String) dict.get(key));
+ put(LICENSE_URL, (String) dict.get(key));
}
}
}
@@ -198,10 +197,10 @@
CapabilityImpl cap = new CapabilityImpl();
cap.setName("bundle");
if (getPresentationName() != null) {
- cap.addP(Resource.PRESENTATION_NAME, getPresentationName());
+ cap.addP(PRESENTATION_NAME, getPresentationName());
}
- cap.addP(Resource.SYMBOLIC_NAME, getSymbolicName());
- cap.addP(Resource.VERSION, getVersion());
+ cap.addP(SYMBOLIC_NAME, getSymbolicName());
+ cap.addP(VERSION, getVersion());
addCapability(cap);
}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Logger.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Logger.java
similarity index 98%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/Logger.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Logger.java
index f8b8005..b32bb16 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Logger.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Logger.java
@@ -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.BundleContext;
import org.osgi.framework.ServiceReference;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/MapToDictionary.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/MapToDictionary.java
similarity index 97%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/MapToDictionary.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/MapToDictionary.java
index e7996af..81f7d6a 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/MapToDictionary.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/MapToDictionary.java
@@ -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.util.*;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrCommandImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrCommandImpl.java
similarity index 98%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrCommandImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrCommandImpl.java
index f079bd1..90350ab 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrCommandImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrCommandImpl.java
@@ -16,16 +16,18 @@
* 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.lang.reflect.Array;
import java.net.URL;
import java.util.*;
+import org.apache.felix.bundlerepository.Capability;
+import org.apache.felix.bundlerepository.Requirement;
+import org.apache.felix.bundlerepository.Resource;
import org.apache.felix.shell.Command;
import org.osgi.framework.*;
-import org.osgi.service.obr.*;
public class ObrCommandImpl implements Command
{
@@ -45,9 +47,9 @@
private static final String VERBOSE_SWITCH = "-v";
private BundleContext m_context = null;
- private RepositoryAdmin m_repoAdmin = null;
+ private org.apache.felix.bundlerepository.RepositoryAdmin m_repoAdmin = null;
- public ObrCommandImpl(BundleContext context, RepositoryAdmin repoAdmin)
+ public ObrCommandImpl(BundleContext context, org.apache.felix.bundlerepository.RepositoryAdmin repoAdmin)
{
m_context = context;
m_repoAdmin = repoAdmin;
@@ -185,7 +187,7 @@
}
else
{
- Repository[] repos = m_repoAdmin.listRepositories();
+ org.apache.felix.bundlerepository.Repository[] repos = m_repoAdmin.listRepositories();
if ((repos != null) && (repos.length > 0))
{
for (int i = 0; i < repos.length; i++)
@@ -339,7 +341,7 @@
ParsedCommand pc, String command, PrintStream out, PrintStream err)
throws IOException, InvalidSyntaxException
{
- Resolver resolver = m_repoAdmin.resolver();
+ org.apache.felix.bundlerepository.Resolver resolver = m_repoAdmin.resolver();
for (int i = 0; (pc != null) && (i < pc.getTargetCount()); i++)
{
// Find the target's bundle resource.
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrURLStreamHandlerService.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService.java
similarity index 97%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrURLStreamHandlerService.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService.java
index d0e6141..568da7c 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ObrURLStreamHandlerService.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ObrURLStreamHandlerService.java
@@ -16,15 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
-import java.util.Iterator;
-import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
@@ -34,8 +32,7 @@
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.Version;
-import org.osgi.service.obr.RepositoryAdmin;
-import org.osgi.service.obr.Resource;
+import org.apache.felix.bundlerepository.*;
import org.osgi.service.url.AbstractURLStreamHandlerService;
/**
@@ -87,7 +84,7 @@
* @param context context to use
* @param admin admin to use
*/
- public ObrURLStreamHandlerService(BundleContext context, RepositoryAdmin admin)
+ public ObrURLStreamHandlerService(BundleContext context, org.apache.felix.bundlerepository.RepositoryAdmin admin)
{
m_bundleContext = context;
m_reRepositoryAdmin = admin;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/PropertyImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/PropertyImpl.java
similarity index 97%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/PropertyImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/PropertyImpl.java
index 27020ea..78acf43 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/PropertyImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/PropertyImpl.java
@@ -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.net.MalformedURLException;
import java.net.URL;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Attribute.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Attribute.java
similarity index 96%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Attribute.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Attribute.java
index 2d20a22..9aff3c4 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Attribute.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Attribute.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
public class R4Attribute
{
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Directive.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Directive.java
similarity index 95%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Directive.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Directive.java
index 2698581..3d2618b 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Directive.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Directive.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
public class R4Directive
{
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Export.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Export.java
similarity index 99%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Export.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Export.java
index 3fec228..2517ca7 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Export.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Export.java
@@ -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.util.*;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Import.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Import.java
similarity index 99%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Import.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Import.java
index 4434973..d7c30ba 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Import.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Import.java
@@ -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.Constants;
import org.osgi.framework.Version;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Package.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Package.java
similarity index 99%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Package.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Package.java
index 52879f7..700c1c7 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/R4Package.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/R4Package.java
@@ -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.util.ArrayList;
import java.util.List;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Referral.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Referral.java
similarity index 96%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/Referral.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Referral.java
index ad34c76..8d6317b 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Referral.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Referral.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
public class Referral
{
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdminImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java
similarity index 92%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdminImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java
index fdbc2c9..5a1db98 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryAdminImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java
@@ -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.net.MalformedURLException;
import java.net.URL;
@@ -28,15 +28,15 @@
import java.util.Map;
import java.util.StringTokenizer;
+import org.apache.felix.bundlerepository.Capability;
+import org.apache.felix.bundlerepository.Requirement;
+import org.apache.felix.bundlerepository.Resolver;
+import org.apache.felix.bundlerepository.Resource;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.service.obr.Capability;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.RepositoryAdmin;
-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.RepositoryAdmin;
public class RepositoryAdminImpl implements RepositoryAdmin
{
@@ -62,12 +62,12 @@
m_local = new LocalRepositoryImpl(context, logger);
}
- public Repository getLocalRepository()
+ public org.apache.felix.bundlerepository.Repository getLocalRepository()
{
return m_local;
}
- public Repository getSystemRepository()
+ public org.apache.felix.bundlerepository.Repository getSystemRepository()
{
return m_system;
}
@@ -82,7 +82,7 @@
return addRepository(url, Integer.MAX_VALUE);
}
- public synchronized Repository addRepository(URL url, int hopCount) throws Exception
+ public synchronized RepositoryImpl addRepository(URL url, int hopCount) throws Exception
{
if (!m_urlList.contains(url))
{
@@ -92,7 +92,7 @@
// If the repository URL is a duplicate, then we will just
// replace the existing repository object with a new one,
// which is effectively the same as refreshing the repository.
- Repository repo = new RepositoryImpl(this, url, hopCount, m_logger);
+ RepositoryImpl repo = new RepositoryImpl(this, url, hopCount, m_logger);
m_repoMap.put(url, repo);
return repo;
}
@@ -112,12 +112,6 @@
return (Repository[]) m_repoMap.values().toArray(new Repository[m_repoMap.size()]);
}
- public synchronized Resource getResource(String respositoryId)
- {
- // TODO: OBR - Auto-generated method stub
- return null;
- }
-
public synchronized Resolver resolver()
{
if (!m_initialized)
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryImpl.java
similarity index 95%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryImpl.java
index 5635619..a1635a9 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryImpl.java
@@ -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.BufferedReader;
import java.io.IOException;
@@ -31,23 +31,22 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-import org.apache.felix.bundlerepository.metadataparser.XmlCommonHandler;
-import org.apache.felix.bundlerepository.metadataparser.kxmlsax.KXml2SAXParser;
-import org.osgi.service.obr.Capability;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.Requirement;
-import org.osgi.service.obr.Resource;
+import org.apache.felix.bundlerepository.Capability;
+import org.apache.felix.bundlerepository.Requirement;
+import org.apache.felix.bundlerepository.Resource;
+import org.apache.felix.bundlerepository.impl.metadataparser.XmlCommonHandler;
+import org.apache.felix.bundlerepository.impl.metadataparser.kxmlsax.KXml2SAXParser;
+import org.apache.felix.bundlerepository.Repository;
public class RepositoryImpl implements Repository
{
public static final String OBR_PARSER_CLASS = "obr.parser.class";
- public static final String OBR_PARSER_CLASS_DEFAULT = "org.apache.felix.bundlerepository.StaxParser";
+ public static final String OBR_PARSER_CLASS_DEFAULT = "org.apache.felix.bundlerepository.impl.StaxParser";
private String m_name = null;
private long m_lastmodified = 0;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RequirementImpl.java
similarity index 94%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RequirementImpl.java
index 6c42ec8..10bdead 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RequirementImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RequirementImpl.java
@@ -16,13 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
-import org.osgi.framework.Filter;
+import org.apache.felix.bundlerepository.Capability;
+import org.apache.felix.bundlerepository.Requirement;
+import org.apache.felix.bundlerepository.Resource;
import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.service.obr.Capability;
-import org.osgi.service.obr.Requirement;
-import org.osgi.service.obr.Resource;
public class RequirementImpl implements Requirement
{
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java
similarity index 98%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java
index b6bc309..b27aafc 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java
@@ -16,13 +16,14 @@
* 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.*;
+import org.apache.felix.bundlerepository.*;
+import org.apache.felix.bundlerepository.Resolver;
import org.osgi.framework.*;
-import org.osgi.service.obr.*;
public class ResolverImpl implements Resolver
{
@@ -455,7 +456,7 @@
{
if (Thread.interrupted())
{
- throw new InterruptedResolutionException();
+ throw new org.apache.felix.bundlerepository.InterruptedResolutionException();
}
}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceComparator.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceComparator.java
similarity index 92%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceComparator.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceComparator.java
index 40bd499..35f7439 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceComparator.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceComparator.java
@@ -16,11 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
import java.util.Comparator;
-import org.osgi.service.obr.Resource;
+import org.apache.felix.bundlerepository.Resource;
class ResourceComparator implements Comparator
{
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java
similarity index 92%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java
index fd454f8..10f99ab 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResourceImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResourceImpl.java
@@ -16,21 +16,23 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.bundlerepository;
+package org.apache.felix.bundlerepository.impl;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
+import org.apache.felix.bundlerepository.Capability;
+import org.apache.felix.bundlerepository.Repository;
+import org.apache.felix.bundlerepository.Requirement;
+import org.apache.felix.bundlerepository.Resource;
import org.osgi.framework.Version;
-import org.osgi.service.obr.*;
public class ResourceImpl implements Resource
{
- private final String URI = "uri";
private final Map m_map = new HashMap();
- private Repository m_repo = null;
+ private RepositoryImpl m_repo = null;
private List m_capList = new ArrayList();
private List m_reqList = new ArrayList();
@@ -125,7 +127,7 @@
{
convertURItoURL();
}
- return (URL) m_map.get(URL);
+ return (URL) m_map.get(Resource.URI);
}
public Requirement[] getRequirements()
@@ -176,7 +178,7 @@
return m_repo;
}
- protected void setRepository(Repository repo)
+ protected void setRepository(RepositoryImpl repo)
{
m_repo = repo;
}
@@ -205,7 +207,7 @@
{
m_sourceURI = (String) value;
}
- else if (key.equals("javadoc"))
+ else if (key.equals(JAVADOC))
{
m_javadocURI = (String) value;
}
@@ -250,7 +252,7 @@
URL base = m_repo.getURL();
if (m_resourceURI != null)
{
- m_map.put(URL, new URL(base, m_resourceURI));
+ m_map.put(URI, new URL(base, m_resourceURI));
}
if (m_docURI != null)
{
@@ -266,7 +268,7 @@
}
if (m_javadocURI != null)
{
- m_map.put("javadoc", new URL(base, m_javadocURI));
+ m_map.put(JAVADOC, new URL(base, m_javadocURI));
}
m_converted = true;
}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/StaxParser.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
similarity index 99%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/StaxParser.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
index 5da9bf4..646bb5f 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/StaxParser.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StaxParser.java
@@ -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.InputStream;
import javax.xml.stream.Location;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/StringSet.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StringSet.java
similarity index 95%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/StringSet.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StringSet.java
index b23fd07..c05d417 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/StringSet.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/StringSet.java
@@ -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.util.*;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/SystemRepositoryImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SystemRepositoryImpl.java
similarity index 93%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/SystemRepositoryImpl.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SystemRepositoryImpl.java
index 0ed0c56..1bca652 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/SystemRepositoryImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/SystemRepositoryImpl.java
@@ -16,14 +16,14 @@
* 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 org.apache.felix.bundlerepository.Resource;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.Resource;
+import org.apache.felix.bundlerepository.Repository;
public class SystemRepositoryImpl implements Repository
{
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Util.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Util.java
similarity index 99%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/Util.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Util.java
index 06d1b3d..5ca6d72 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/Util.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/Util.java
@@ -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;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/VersionRange.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/VersionRange.java
similarity index 98%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/VersionRange.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/VersionRange.java
index b4fb9ac..b82bafc 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/VersionRange.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/VersionRange.java
@@ -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;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ClassUtility.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ClassUtility.java
similarity index 98%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ClassUtility.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ClassUtility.java
index 6ff109e..5764068 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ClassUtility.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ClassUtility.java
@@ -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
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/KXml2MetadataHandler.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/KXml2MetadataHandler.java
similarity index 87%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/KXml2MetadataHandler.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/KXml2MetadataHandler.java
index 88a99cd..0e48a1f 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/KXml2MetadataHandler.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/KXml2MetadataHandler.java
@@ -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
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MappingProcessingInstructionHandler.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MappingProcessingInstructionHandler.java
similarity index 96%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MappingProcessingInstructionHandler.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MappingProcessingInstructionHandler.java
index d3f52b2..4387108 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MappingProcessingInstructionHandler.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MappingProcessingInstructionHandler.java
@@ -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
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MetadataHandler.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MetadataHandler.java
similarity index 97%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MetadataHandler.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MetadataHandler.java
index bd0cbfc..4994022 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/MetadataHandler.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/MetadataHandler.java
@@ -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;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ReplaceUtility.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ReplaceUtility.java
similarity index 97%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ReplaceUtility.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ReplaceUtility.java
index f238ed4..26cb4d4 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/ReplaceUtility.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/ReplaceUtility.java
@@ -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;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlCommonHandler.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlCommonHandler.java
similarity index 99%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlCommonHandler.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlCommonHandler.java
index 7a29b1d..6920a98 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlCommonHandler.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlCommonHandler.java
@@ -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;
/**
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlMetadataHandler.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlMetadataHandler.java
similarity index 93%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlMetadataHandler.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlMetadataHandler.java
index f452fab..2c6e89f 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/XmlMetadataHandler.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/XmlMetadataHandler.java
@@ -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
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXHandler.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXHandler.java
similarity index 96%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXHandler.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXHandler.java
index 4997df6..a2b2d62 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXHandler.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXHandler.java
@@ -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;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXParser.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXParser.java
similarity index 97%
rename from bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXParser.java
rename to bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXParser.java
index 04dd8d1..78db998 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/metadataparser/kxmlsax/KXml2SAXParser.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/metadataparser/kxmlsax/KXml2SAXParser.java
@@ -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;
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java
new file mode 100644
index 0000000..0699555
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/CapabilityWrapper.java
@@ -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();
+ }
+}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java
new file mode 100644
index 0000000..27599f0
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryAdminWrapper.java
@@ -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();
+ }
+
+}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java
new file mode 100644
index 0000000..a7dd140
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RepositoryWrapper.java
@@ -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();
+ }
+
+}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java
new file mode 100644
index 0000000..06057db
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/RequirementWrapper.java
@@ -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));
+ }
+}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java
new file mode 100644
index 0000000..af55277
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResolverWrapper.java
@@ -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);
+ }
+}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java
new file mode 100644
index 0000000..f7b8856
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/ResourceWrapper.java
@@ -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());
+ }
+}
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java
new file mode 100644
index 0000000..df132c3
--- /dev/null
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/wrapper/Wrapper.java
@@ -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;
+ }
+
+}
diff --git a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/FilterImplTest.java
similarity index 97%
rename from bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java
rename to bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/FilterImplTest.java
index a660817..8fd48d2 100644
--- a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java
+++ b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/FilterImplTest.java
@@ -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
diff --git a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryAdminTest.java b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryAdminTest.java
similarity index 89%
rename from bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryAdminTest.java
rename to bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryAdminTest.java
index 8535ade..3ca41e3 100644
--- a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryAdminTest.java
+++ b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryAdminTest.java
@@ -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());
diff --git a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryImplTest.java b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java
similarity index 96%
rename from bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryImplTest.java
rename to bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java
index 38d6971..50836bb 100644
--- a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/RepositoryImplTest.java
+++ b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/RepositoryImplTest.java
@@ -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
{
diff --git a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/ResolverImplTest.java b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/ResolverImplTest.java
similarity index 91%
rename from bundlerepository/src/test/java/org/apache/felix/bundlerepository/ResolverImplTest.java
rename to bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/ResolverImplTest.java
index 1981172..37f4cb4 100644
--- a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/ResolverImplTest.java
+++ b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/ResolverImplTest.java
@@ -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
}
diff --git a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/StaxParserTest.java b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/StaxParserTest.java
similarity index 92%
rename from bundlerepository/src/test/java/org/apache/felix/bundlerepository/StaxParserTest.java
rename to bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/StaxParserTest.java
index 9d3c2f4..1a5139e 100644
--- a/bundlerepository/src/test/java/org/apache/felix/bundlerepository/StaxParserTest.java
+++ b/bundlerepository/src/test/java/org/apache/felix/bundlerepository/impl/StaxParserTest.java
@@ -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
{