You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by jw...@apache.org on 2012/11/26 17:42:31 UTC
svn commit: r1413711 - in /aries/trunk/subsystem: subsystem-api/
subsystem-api/src/main/java/org/apache/aries/subsystem/
subsystem-api/src/main/java/org/osgi/service/repository/ subsystem-bundle/
subsystem-core/src/main/java/org/apache/aries/subsystem/...
Author: jwross
Date: Mon Nov 26 16:42:30 2012
New Revision: 1413711
URL: http://svn.apache.org/viewvc?rev=1413711&view=rev
Log:
[ARIES-965] Include the org.osgi.service.repository package and both import and export it.
Subsystems requires the API but not an implementation. The package was therefore included as a convenience for
users who also do not need a repository implementation.
Also added missing packageinfo files.
Added:
aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo
aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/
aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/ContentNamespace.java
aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/Repository.java
aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/RepositoryContent.java
aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/package-info.java
aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/packageinfo
aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/packageinfo
aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/packageinfo
Modified:
aries/trunk/subsystem/subsystem-api/pom.xml
aries/trunk/subsystem/subsystem-bundle/pom.xml
Modified: aries/trunk/subsystem/subsystem-api/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-api/pom.xml?rev=1413711&r1=1413710&r2=1413711&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-api/pom.xml (original)
+++ aries/trunk/subsystem/subsystem-api/pom.xml Mon Nov 26 16:42:30 2012
@@ -42,9 +42,15 @@
<properties>
<!-- Export package versions are maintained in packageinfo files -->
<aries.osgi.export.pkg>
- org.osgi.service.subsystem,
- org.apache.aries.subsystem
+ org.apache.aries.subsystem,
+ org.osgi.service.repository,
+ org.osgi.service.subsystem
</aries.osgi.export.pkg>
+ <aries.osgi.import>
+ org.osgi.service.repository;version="[1.0,2)",
+ org.osgi.service.subsystem;version="[1.0,2)",
+ *
+ </aries.osgi.import>
</properties>
<dependencies>
Added: aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo?rev=1413711&view=auto
==============================================================================
--- aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo (added)
+++ aries/trunk/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo Mon Nov 26 16:42:30 2012
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version 1.0.0
Added: aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/ContentNamespace.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/ContentNamespace.java?rev=1413711&view=auto
==============================================================================
--- aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/ContentNamespace.java (added)
+++ aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/ContentNamespace.java Mon Nov 26 16:42:30 2012
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) OSGi Alliance (2011, 2012). 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.
+ */
+
+package org.osgi.service.repository;
+
+import org.osgi.resource.Namespace;
+
+/**
+ * Content Capability and Requirement Namespace.
+ *
+ * <p>
+ * This class defines the names for the attributes and directives for this
+ * namespace. All unspecified capability attributes are of type {@code String}
+ * and are used as arbitrary matching attributes for the capability. The values
+ * associated with the specified directive and attribute keys are of type
+ * {@code String}, unless otherwise indicated.
+ *
+ * @Immutable
+ * @version $Id$
+ */
+public final class ContentNamespace extends Namespace {
+
+ /**
+ * Namespace name for content capabilities and requirements.
+ *
+ * <p>
+ * Also, the capability attribute used to specify the unique identifier of
+ * the content. This identifier is the {@code SHA-256} hash of the content.
+ */
+ public static final String CONTENT_NAMESPACE = "osgi.content";
+
+ /**
+ * The capability attribute that contains the URL to the content.
+ */
+ public static final String CAPABILITY_URL_ATTRIBUTE = "url";
+
+ /**
+ * The capability attribute that contains the size, in bytes, of the
+ * content. The value of this attribute must be of type {@code Long}.
+ */
+ public static final String CAPABILITY_SIZE_ATTRIBUTE = "size";
+
+ /**
+ * The capability attribute that defines the IANA MIME Type/Format for this
+ * content.
+ */
+ public static final String CAPABILITY_MIME_ATTRIBUTE = "mime";
+
+ private ContentNamespace() {
+ // empty
+ }
+}
Added: aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/Repository.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/Repository.java?rev=1413711&view=auto
==============================================================================
--- aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/Repository.java (added)
+++ aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/Repository.java Mon Nov 26 16:42:30 2012
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) OSGi Alliance (2006, 2012). 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.osgi.service.repository;
+
+import java.util.Collection;
+import java.util.Map;
+import org.osgi.resource.Capability;
+import org.osgi.resource.Requirement;
+import org.osgi.resource.Resource;
+
+/**
+ * A repository service that contains {@link Resource resources}.
+ *
+ * <p>
+ * Repositories may be registered as services and may be used as by a resolve
+ * context during resolver operations.
+ *
+ * <p>
+ * Repositories registered as services may be filtered using standard service
+ * properties.
+ *
+ * @ThreadSafe
+ * @noimplement
+ * @version $Id$
+ */
+public interface Repository {
+ /**
+ * Service property to provide URLs related to this repository.
+ *
+ * <p>
+ * The value of this property must be of type {@code String},
+ * {@code String[]}, or {@code Collection<String>}.
+ */
+ String URL = "repository.url";
+
+ /**
+ * Find the capabilities that match the specified requirements.
+ *
+ * @param requirements The requirements for which matching capabilities
+ * should be returned. Must not be {@code null}.
+ * @return A map of matching capabilities for the specified requirements.
+ * Each specified requirement must appear as a key in the map. If
+ * there are no matching capabilities for a specified requirement,
+ * then the value in the map for the specified requirement must be
+ * an empty collection. The returned map is the property of the
+ * caller and can be modified by the caller.
+ */
+ Map<Requirement, Collection<Capability>> findProviders(Collection<? extends Requirement> requirements);
+}
Added: aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/RepositoryContent.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/RepositoryContent.java?rev=1413711&view=auto
==============================================================================
--- aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/RepositoryContent.java (added)
+++ aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/RepositoryContent.java Mon Nov 26 16:42:30 2012
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) OSGi Alliance (2012). 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.
+ */
+
+package org.osgi.service.repository;
+
+import java.io.InputStream;
+import org.osgi.resource.Resource;
+
+/**
+ * An accessor for the default content of a resource.
+ *
+ * All {@link Resource} objects which represent resources in a
+ * {@link Repository} must implement this interface. A user of the resource can
+ * then cast the {@link Resource} object to this type and then obtain an
+ * {@code InputStream} to the default content of the resource.
+ *
+ * @ThreadSafe
+ * @noimplement
+ * @version $Id$
+ */
+public interface RepositoryContent {
+
+ /**
+ * Returns a new input stream to the default format of this resource.
+ *
+ * @return A new input stream for associated resource.
+ */
+ InputStream getContent();
+}
Added: aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/package-info.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/package-info.java?rev=1413711&view=auto
==============================================================================
--- aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/package-info.java (added)
+++ aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/package-info.java Mon Nov 26 16:42:30 2012
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) OSGi Alliance (2010, 2012). 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.
+ */
+
+/**
+ * Repository Service Package Version 1.0.
+ *
+ * <p>
+ * Bundles wishing to use this package must list the package in the
+ * Import-Package header of the bundle's manifest. This package has two types of
+ * users: the consumers that use the API in this package and the providers that
+ * implement the API in this package.
+ *
+ * <p>
+ * Example import for consumers using the API in this package:
+ * <p>
+ * {@code Import-Package: org.osgi.service.repository; version="[1.0,2.0)"}
+ * <p>
+ * Example import for providers implementing the API in this package:
+ * <p>
+ * {@code Import-Package: org.osgi.service.repository; version="[1.0,1.1)"}
+ *
+ * @version $Id$
+ */
+
+package org.osgi.service.repository;
+
Added: aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/packageinfo
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/packageinfo?rev=1413711&view=auto
==============================================================================
--- aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/packageinfo (added)
+++ aries/trunk/subsystem/subsystem-api/src/main/java/org/osgi/service/repository/packageinfo Mon Nov 26 16:42:30 2012
@@ -0,0 +1 @@
+version 1.0
Modified: aries/trunk/subsystem/subsystem-bundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-bundle/pom.xml?rev=1413711&r1=1413710&r2=1413711&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-bundle/pom.xml (original)
+++ aries/trunk/subsystem/subsystem-bundle/pom.xml Mon Nov 26 16:42:30 2012
@@ -43,6 +43,7 @@
org.apache.aries.subsystem.core.internal.Activator
</aries.osgi.activator>
<aries.osgi.import>
+ org.osgi.service.repository;version="[1.0,2)",
org.osgi.service.subsystem;version="[1.0,2)",
*
</aries.osgi.import>
Added: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/packageinfo
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/packageinfo?rev=1413711&view=auto
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/packageinfo (added)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/packageinfo Mon Nov 26 16:42:30 2012
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version 1.0.0
Added: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/packageinfo
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/packageinfo?rev=1413711&view=auto
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/packageinfo (added)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/packageinfo Mon Nov 26 16:42:30 2012
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+version 1.0.0