aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwr...@apache.org
Subject svn commit: r1588265 [1/3] - in /aries/branches/subsystemsR6/subsystem: subsystem-api/ subsystem-api/src/main/java/org/apache/aries/subsystem/ subsystem-api/src/main/java/org/osgi/service/subsystem/ subsystem-bundle/ subsystem-core/ subsystem-core/src/...
Date Thu, 17 Apr 2014 14:11:55 GMT
Author: jwross
Date: Thu Apr 17 14:11:53 2014
New Revision: 1588265

URL: http://svn.apache.org/r1588265
Log:
infrastructure updates for osgi r6

copy osgi subsystem api version 1.1
increment aries subsystem api version from 1.0 to 1.1
implement noop versions of new methods
fix api version imports in core pom
upgrade to equinox luna
upgrade to org.osgi.core-6.0.0
update uber bundle
fix test failures due to luna upgrade

initial support for translation of subsystem manifest headers

initial support for application service dependencies

initial support for dynamic package imports added by weaving hooks

initial support for installer supplied deployment manifests

initial support for access to deployment manifest headers

RawSubsystemResource - add comments to computeRequirements method

SubsystemResource - remove unused public method getResources

PreferredProviderRepository - initialized never set to true

SubsystemResource - findRegionForCapabilityValidation - when calculating the from region, need to ask if the current
subsystem accepts dependencies

RawSubsystemResource - fix issue with empty local repository when computing requirements

SubsystemImportServiceRequirement - fix issue where filter had two objectClass attributes.

[ARIES-1146] Aries Subsystem use of org.osgi.service.repository.Repository interface problematic

The subsystem-api bundle continues to provide the org.osgi.service.repository API at version 1.0 for backwards
compatibility.

The subsystem-impl bundle no longer even imports the org.osgi.service.repository API. Instead, it looks for all registered
repository services, regardless of version, then uses reflection to invoke the 1.0 methods Repository.findProviders and
RepositoryContent.getContent.

Added org.apache.aries.subsystem.core.repository package. This is an internal copy of the OSGi Repository API for internal
use only.

PreferredProviderRepository - remove need for localRepository variable

SubsystemTest - fix unnecessary package import for org.osgi.service.repository.RepositoryContent

initial support for preferred provider not always a cure for uses constraint violations

fixed issue in woven class listener when woven bundle's context is null

removed weaving hook work around and updated itests accordingly

Added:
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageHeader.java   (with props)
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageRequirement.java   (with props)
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemLocalizationHeader.java   (with props)
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetDeploymentHeadersAction.java   (contents, props changed)
      - copied, changed from r1536385, aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResolveContext.java   (with props)
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/TranslationFile.java   (with props)
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/WovenClassListener.java   (with props)
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/repository/
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/repository/ContentNamespace.java   (with props)
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/repository/Repository.java   (with props)
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/repository/RepositoryContent.java   (with props)
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/repository/package-info.java   (contents, props changed)
      - copied, changed from r1536385, aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/package-info.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/repository/packageinfo   (contents, props changed)
      - copied, changed from r1536385, aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/packageinfo
    aries/branches/subsystemsR6/subsystem/subsystem-itests/src/test/resources/META-INF/platform-equinox/definition-3.10.0.V20131210-2136.xml   (with props)
Modified:
    aries/branches/subsystemsR6/subsystem/subsystem-api/pom.xml
    aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java
    aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo
    aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/Subsystem.java
    aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemConstants.java
    aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemException.java
    aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemPermission.java
    aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/package-info.java
    aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/packageinfo
    aries/branches/subsystemsR6/subsystem/subsystem-bundle/pom.xml
    aries/branches/subsystemsR6/subsystem/subsystem-core/pom.xml
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/Grammar.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/HeaderFactory.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemExportServiceCapability.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemImportServiceRequirement.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemManifest.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResource.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/CompositeRepository.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ContentRepository.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/DependencyCalculator.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/InstallAction.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/LocalRepository.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/PreferredProviderRepository.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RawSubsystemResource.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/RepositoryServiceRepository.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ResourceHelper.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/StartAction.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResource.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SubsystemResourceInstaller.java
    aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/SystemRepository.java
    aries/branches/subsystemsR6/subsystem/subsystem-itests/pom.xml
    aries/branches/subsystemsR6/subsystem/subsystem-itests/src/test/bundles/dynamicImport/META-INF/MANIFEST.MF
    aries/branches/subsystemsR6/subsystem/subsystem-itests/src/test/bundles/helloImpl/META-INF/MANIFEST.MF
    aries/branches/subsystemsR6/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/DynamicImportTest.java
    aries/branches/subsystemsR6/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/RootSubsystemTest.java
    aries/branches/subsystemsR6/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/SubsystemTest.java
    aries/branches/subsystemsR6/subsystem/subsystem-itests/src/test/java/org/apache/aries/subsystem/itests/UnmanagedBundleTest.java
    aries/branches/subsystemsR6/subsystem/subsystem-itests/src/test/java/org/ops4j/pax/runner/platform/equinox/internal/SsActivator.java
    aries/branches/subsystemsR6/subsystem/subsystem-itests/src/test/resources/ss-runner.properties

Modified: aries/branches/subsystemsR6/subsystem/subsystem-api/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-api/pom.xml?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-api/pom.xml (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-api/pom.xml Thu Apr 17 14:11:53 2014
@@ -29,7 +29,7 @@
     <artifactId>org.apache.aries.subsystem.api</artifactId>
     <packaging>bundle</packaging>
     <name>Apache Aries Subsystem API</name>
-    <version>1.0.1-SNAPSHOT</version>
+    <version>1.1.0-SNAPSHOT</version>
     <description>Subsystems API.</description>
 
      <scm>
@@ -46,8 +46,8 @@
             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)",
+    		org.osgi.service.repository;version="[1.0,1.1)",
+    		org.osgi.service.subsystem;version="[1.1,1.2)",
     		*
     	</aries.osgi.import>
     </properties>
@@ -61,9 +61,14 @@
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
-            <version>5.0.0</version>
+            <version>6.0.0</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.annotation</artifactId>
+            <version>6.0.0</version>
+        </dependency>
     </dependencies>
     
     <build>

Modified: aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/AriesSubsystem.java Thu Apr 17 14:11:53 2014
@@ -46,12 +46,15 @@ public interface AriesSubsystem extends 
 	@Override
 	AriesSubsystem install(String location, InputStream content);
 	
+	@Override
+	AriesSubsystem install(String location, InputStream content, InputStream deploymentManifest);
+	
 	/**
 	 * Installs a subsystem from the specified location identifier and content.
 	 * <p>
 	 * This method performs the same function as calling
-	 * {@link #install(String, InputStream)} except the content is retrieved
-	 * from the specified {@link IDirectory} instead.
+	 * {@link #install(String, IDirectory, InputStream)} with a null deployment
+	 * manifest.
 	 * 
 	 * @param location The location identifier of the subsystem to install.
 	 * @param content The directory from which this subsystem will be read or
@@ -66,7 +69,35 @@ public interface AriesSubsystem extends 
 	 * @throws SecurityException If the caller does not have the appropriate
 	 *         {@link SubsystemPermission}[installed subsystem,LIFECYCLE], and
 	 *         the runtime supports permissions.
-	 * @see #install(String, InputStream)
+	 * @see #install(String, IDirectory, InputStream)
 	 */
 	AriesSubsystem install(String location, IDirectory content);
+	
+	/**
+	 * Installs a subsystem from the specified location identifier and content
+	 * but uses the provided deployment manifest, if any, rather than the 
+	 * computed one or the one provided as part of the content.
+	 * <p>
+	 * This method performs the same function as calling
+	 * {@link #install(String, InputStream, InputStream)} except the content is 
+	 * retrieved from the specified {@link IDirectory} instead.
+	 * 
+	 * @param location The location identifier of the subsystem to install.
+	 * @param content The directory from which this subsystem will be read or
+	 *        {@code null} to indicate the directory must be created from the
+	 *        specified location identifier.
+	 * @param deploymentManifest The deployment manifest to use in lieu of any
+	 *        others.
+	 * @return The installed subsystem.
+	 * @throws IllegalStateException If this subsystem's state is in
+	 *         {@link State#INSTALLING INSTALLING}, {@link State#INSTALL_FAILED
+	 *         INSTALL_FAILED}, {@link State#UNINSTALLING UNINSTALLING},
+	 *         {@link State#UNINSTALLED UNINSTALLED}.
+	 * @throws SubsystemException If the installation failed.
+	 * @throws SecurityException If the caller does not have the appropriate
+	 *         {@link SubsystemPermission}[installed subsystem,LIFECYCLE], and
+	 *         the runtime supports permissions.
+	 * @see #install(String, InputStream, InputStream)
+	 */
+	AriesSubsystem install(String location, IDirectory content, InputStream deploymentManifest);
 }

Modified: aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/apache/aries/subsystem/packageinfo Thu Apr 17 14:11:53 2014
@@ -16,4 +16,4 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-version 1.0.0
+version 1.1.0

Modified: aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/Subsystem.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/Subsystem.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/Subsystem.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/Subsystem.java Thu Apr 17 14:11:53 2014
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2012, 2013). 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.
@@ -20,6 +20,7 @@ import java.io.InputStream;
 import java.util.Collection;
 import java.util.Locale;
 import java.util.Map;
+import org.osgi.annotation.versioning.ProviderType;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Version;
 import org.osgi.framework.namespace.IdentityNamespace;
@@ -72,7 +73,7 @@ import org.osgi.resource.Resource;
  * framework.</li>
  * <li>{@link #getSubsystemId() ID} - An identifier generated by the
  * implementation as part of installation. It is guaranteed to be unique within
- * the same framework.
+ * the same framework.</li>
  * <li>{@link #getSymbolicName() Symbolic Name}/{@link #getVersion() Version} -
  * The combination of symbolic name and version is guaranteed to be unique
  * within the same region. Although {@link #getType() type} is not formally part
@@ -157,9 +158,9 @@ import org.osgi.resource.Resource;
  * </ul>
  * 
  * @ThreadSafe
- * @noimplement
- * @version $Id: 73028a6997272cbac7e90ae00eb0f28afd14c8ee $
+ * @author $Id: 46dbc3d05b6c0fcd6962ffe433b62cbd284c3d0d $
  */
+@ProviderType
 public interface Subsystem {
 	/**
 	 * An enumeration of the possible states of a subsystem.
@@ -375,6 +376,28 @@ public interface Subsystem {
 	public Collection<Resource> getConstituents();
 
 	/**
+	 * Returns the headers for this subsystem's deployment manifest.
+	 * <p>
+	 * Each key in the map is a header name and the value of the key is the
+	 * corresponding header value. Because header names are case-insensitive,
+	 * the methods of the map must treat the keys in a case-insensitive manner.
+	 * If the header name is not found, {@code null} is returned. Both original
+	 * and derived headers will be included in the map.
+	 * <p>
+	 * This method must continue to return the headers while this subsystem is
+	 * in the {@link State#INSTALL_FAILED INSTALL_FAILED} or
+	 * {@link State#UNINSTALLED UNINSTALLED} states.
+	 * 
+	 * @return The headers for this subsystem's deployment manifest. The
+	 *         returned map is unmodifiable.
+	 * @throws SecurityException If the caller does not have the appropriate
+	 *         {@link SubsystemPermission}[this,METADATA], and the runtime
+	 *         supports permissions.
+	 * @since 1.1
+	 */
+	public Map<String, String> getDeploymentHeaders();
+
+	/**
 	 * Returns the current state of this subsystem.
 	 * <p>
 	 * This method must continue to return this subsystem's state while this
@@ -514,16 +537,18 @@ public interface Subsystem {
 	 * reading the content, an installation failure results.</li>
 	 * <li>If an installed subsystem with the same symbolic name and version
 	 * already exists within this subsystem's region, complete the installation
-	 * with one of the following.<br/>
-	 * - If the installing and installed subsystems' types are not equal, an
-	 * installation failure results.<br/>
-	 * - If the installing and installed subsystems' types are equal, and the
+	 * with one of the following.
+	 * <ul>
+	 * <li>If the installing and installed subsystems' types are not equal, an
+	 * installation failure results.</li>
+	 * <li>If the installing and installed subsystems' types are equal, and the
 	 * installed subsystem is already a child of this subsystem, return the
-	 * installed subsystem.<br/>
-	 * - If the installing and installed subsystems' types are equal, and the
+	 * installed subsystem.</li>
+	 * <li>If the installing and installed subsystems' types are equal, and the
 	 * installed subsystem is not already a child of this subsystem, add the
 	 * installed subsystem as a child of this subsystem, increment the installed
-	 * subsystem's reference count by one, and return the installed subsystem.
+	 * subsystem's reference count by one, and return the installed subsystem.</li>
+	 * </ul>
 	 * <li>Create a new subsystem based on the specified location and content.</li>
 	 * <li>If the subsystem is scoped, install and start a new region context
 	 * bundle.</li>
@@ -557,7 +582,7 @@ public interface Subsystem {
 	 * <li>Change the state to {@link State#INSTALL_FAILED INSTALL_FAILED}.</li>
 	 * <li>Change the state to {@link State#UNINSTALLING UNINSTALLING}.</li>
 	 * <li>All content and dependencies which may have been installed by the
-	 * installing process must be uninstalled.
+	 * installing process must be uninstalled.</li>
 	 * <li>Change the state to {@link State#UNINSTALLED UNINSTALLED}.</li>
 	 * <li>Unregister the subsystem service.</li>
 	 * <li>If the subsystem is a scoped subsystem then, uninstall the region
@@ -584,6 +609,39 @@ public interface Subsystem {
 	public Subsystem install(String location, InputStream content);
 
 	/**
+	 * Installs a subsystem from the specified content according to the
+	 * specified deployment manifest.
+	 * <p>
+	 * This method installs a subsystem using the provided deployment manifest
+	 * instead of the one in the archive, if any, or a computed one. If the
+	 * deployment manifest is {@code null}, the behavior is exactly the same as
+	 * in the {@link #install(String, InputStream)} method. Implementations must
+	 * support deployment manifest input streams in the format described by
+	 * section 134.2 of the Subsystem Service Specification. If the deployment
+	 * manifest does not conform to the subsystem manifest (see 134.15.2), the
+	 * installation fails.
+	 * 
+	 * @param location The location identifier of the subsystem to be installed.
+	 * @param content The input stream from which this subsystem will be read or
+	 *        {@code null} to indicate the input stream must be created from the
+	 *        specified location identifier. The input stream will always be
+	 *        closed when this method completes, even if an exception is thrown.
+	 * @param deploymentManifest The deployment manifest to use in lieu of the
+	 *        one in the archive, if any, or a computed one.
+	 * @return The installed subsystem.
+	 * @throws IllegalStateException If this subsystem's state is in
+	 *         {@link State#INSTALLING INSTALLING}, {@link State#INSTALL_FAILED
+	 *         INSTALL_FAILED}, {@link State#UNINSTALLING UNINSTALLING},
+	 *         {@link State#UNINSTALLED UNINSTALLED}.
+	 * @throws SubsystemException If the installation failed.
+	 * @throws SecurityException If the caller does not have the appropriate
+	 *         {@link SubsystemPermission}[installed subsystem,LIFECYCLE], and
+	 *         the runtime supports permissions.
+	 * @since 1.1
+	 */
+	public Subsystem install(String location, InputStream content, InputStream deploymentManifest);
+
+	/**
 	 * Starts this subsystem.
 	 * <p>
 	 * The following table shows which actions are associated with each state.
@@ -606,8 +664,7 @@ public interface Subsystem {
 	 * </tr>
 	 * <tr>
 	 * <td>{@link State#INSTALLED INSTALLED}</td>
-	 * <td>{@code Resolve}<br/>
-	 * {@code Start}</td>
+	 * <td>{@code Resolve}, {@code Start}</td>
 	 * </tr>
 	 * <tr>
 	 * <td>{@link State#INSTALL_FAILED INSTALL_FAILED}</td>
@@ -845,8 +902,7 @@ public interface Subsystem {
 	 * </tr>
 	 * <tr>
 	 * <td>{@link State#ACTIVE ACTIVE}</td>
-	 * <td>{@code Stop}<br/>
-	 * {@code Uninstall}</td>
+	 * <td>{@code Stop}, {@code Uninstall}</td>
 	 * </tr>
 	 * <tr>
 	 * <td>{@link State#STOPPING STOPPING}</td>

Modified: aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemConstants.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemConstants.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemConstants.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemConstants.java Thu Apr 17 14:11:53 2014
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2011, 2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2011, 2013). 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.
@@ -25,7 +25,7 @@ package org.osgi.service.subsystem;
  * otherwise indicated.
  * 
  * @Immutable
- * @version $Id: 53f0bd1ccdd14681f09adc3c9dde8e0b95154b71 $
+ * @author $Id: 36e2190a16d3bd0e4ed0e34799286284c0986974 $
  */
 public class SubsystemConstants {
 	private SubsystemConstants() {
@@ -91,22 +91,60 @@ public class SubsystemConstants {
 	public static final String	START_ORDER_DIRECTIVE					= "start-order";
 
 	/**
+	 * Manifest header identifying the categories of a subsystem as a
+	 * comma-delimited list.
+	 * 
+	 * @since 1.1
+	 */
+	public static final String	SUBSYSTEM_CATEGORY						= "Subsystem-Category";
+
+	/**
+	 * Manifest header identifying the contact address where problems with a
+	 * subsystem may be reported; for example, an email address.
+	 * 
+	 * @since 1.1
+	 */
+	public static final String	SUBSYSTEM_CONTACTADDRESS				= "Subsystem-ContactAddress";
+
+	/**
 	 * Manifest header identifying the list of subsystem contents identified by
 	 * a symbolic name and version.
 	 */
 	public static final String	SUBSYSTEM_CONTENT						= "Subsystem-Content";
 
 	/**
+	 * Manifest header identifying a subsystem's copyright information.
+	 * 
+	 * @since 1.1
+	 */
+	public static final String	SUBSYSTEM_COPYRIGHT						= "Subsystem-Copyright";
+
+	/**
 	 * Manifest header identifying the human readable description.
 	 */
 	public static final String	SUBSYSTEM_DESCRIPTION					= "Subsystem-Description";
 
 	/**
+	 * Manifest header identifying a subsystem's documentation URL, from which
+	 * further information about the subsystem may be obtained.
+	 * 
+	 * @since 1.1
+	 */
+	public static final String	SUBSYSTEM_DOCURL						= "Subsystem-DocURL";
+
+	/**
 	 * Manifest header identifying services offered for export.
 	 */
 	public static final String	SUBSYSTEM_EXPORTSERVICE					= "Subsystem-ExportService";
 
 	/**
+	 * Manifest header identifying the icon URL for the subsystem.
+	 * 
+	 * @since 1.1
+	 */
+	public static final String	SUBSYSTEM_ICON							= "Subsystem-Icon";
+
+	/**
 	 * The name of the service property for the
 	 * {@link Subsystem#getSubsystemId() subsystem ID}. The value of this
 	 * property must be of type {@code Long}.
@@ -119,6 +157,29 @@ public class SubsystemConstants {
 	public static final String	SUBSYSTEM_IMPORTSERVICE					= "Subsystem-ImportService";
 
 	/**
+	 * Manifest header identifying a subsystem's license.
+	 * 
+	 * @since 1.1
+	 */
+	public static final String	SUBSYSTEM_LICENSE						= "Subsystem-License";
+
+	/**
+	 * Manifest header identifying the base name of a subsystem's localization
+	 * entries.
+	 * 
+	 * @since 1.1
+	 */
+	public static final String	SUBSYSTEM_LOCALIZATION					= "Subsystem-Localization";
+
+	/**
+	 * Default value for the {@link #SUBSYSTEM_LOCALIZATION
+	 * Subsystem-Localization} manifest header.
+	 * 
+	 * @since 1.1
+	 */
+	public static final String	SUBSYSTEM_LOCALIZATION_DEFAULT_BASENAME	= "OSGI-INF/l10n/subsystem";
+
+	/**
 	 * Manifest header identifying the subsystem manifest version. If not
 	 * present, the default value is {@code 1}.
 	 */
@@ -203,6 +264,13 @@ public class SubsystemConstants {
 	public static final String	SUBSYSTEM_TYPE_FEATURE					= "osgi.subsystem.feature";
 
 	/**
+	 * Manifest header identifying a subsystem's vendor.
+	 * 
+	 * @since 1.1
+	 */
+	public static final String	SUBSYSTEM_VENDOR						= "Subsystem-Vendor";
+
+	/**
 	 * Manifest header value identifying the version of the subsystem. If not
 	 * present, the default value is {@code 0.0.0}.
 	 */

Modified: aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemException.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemException.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemException.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemException.java Thu Apr 17 14:11:53 2014
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2011, 2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2011, 2013). 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.
@@ -19,7 +19,7 @@ package org.osgi.service.subsystem;
 /**
  * A Subsystem exception used to indicate a problem.
  * 
- * @version $Id: 06542037c2bdaa7d328a368223b4f71b7a1c3dea $
+ * @author $Id: ad56ae269d24c698380e80d2f91c76d61ee121ff $
  */
 public class SubsystemException extends RuntimeException {
 	private static final long	serialVersionUID	= 1L;

Modified: aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemPermission.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemPermission.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemPermission.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/SubsystemPermission.java Thu Apr 17 14:11:53 2014
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2013). 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.
@@ -49,7 +49,7 @@ import org.osgi.framework.InvalidSyntaxE
  *           Subsystem.stop
  * lifecycle Subsystem.install
  *           Subsystem.uninstall
- * metadata  Subsystem.getHeaders
+ * metadata  Subsystem.getSubsystemHeaders
  *           Subsystem.getLocation
  * </pre>
  * 
@@ -64,7 +64,7 @@ import org.osgi.framework.InvalidSyntaxE
  * Filter attribute names are processed in a case sensitive manner.
  * 
  * @ThreadSafe
- * @version $Id: 6674ee12cbc60cedd5392edc39793df91aac4a1e $
+ * @author $Id: 5c71d73cc6a3e8b2c2a7a3f188ebcf79b5ef7888 $
  */
 
 public final class SubsystemPermission extends BasicPermission {
@@ -373,6 +373,7 @@ public final class SubsystemPermission e
 	 * @return {@code true} if the specified permission is implied by this
 	 *         object; {@code false} otherwise.
 	 */
+	@Override
 	public boolean implies(Permission p) {
 		if (!(p instanceof SubsystemPermission)) {
 			return false;
@@ -442,6 +443,7 @@ public final class SubsystemPermission e
 	 * @return Canonical string representation of the
 	 *         {@code SubsystemPermission} actions.
 	 */
+	@Override
 	public String getActions() {
 		String result = actions;
 		if (result == null) {
@@ -485,6 +487,7 @@ public final class SubsystemPermission e
 	 * 
 	 * @return A new {@code PermissionCollection} object.
 	 */
+	@Override
 	public PermissionCollection newPermissionCollection() {
 		return new SubsystemPermissionCollection();
 	}
@@ -496,6 +499,7 @@ public final class SubsystemPermission e
 	 * @return {@code true} if {@code obj} is equivalent to this
 	 *         {@code SubsystemPermission}; {@code false} otherwise.
 	 */
+	@Override
 	public boolean equals(Object obj) {
 		if (obj == this) {
 			return true;
@@ -516,6 +520,7 @@ public final class SubsystemPermission e
 	 * 
 	 * @return Hash code value for this object.
 	 */
+	@Override
 	public int hashCode() {
 		int h = 31 * 17 + getName().hashCode();
 		h = 31 * h + getActions().hashCode();
@@ -579,8 +584,8 @@ public final class SubsystemPermission e
 		recurse.set(subsystem);
 		try {
 			final Map<String, Object> map = new HashMap<String, Object>(4);
-			AccessController.doPrivileged(new PrivilegedAction<Object>() {
-				public Object run() {
+			AccessController.doPrivileged(new PrivilegedAction<Void>() {
+				public Void run() {
 					map.put("id", new Long(subsystem.getSubsystemId()));
 					map.put("location", subsystem.getLocation());
 					map.put("name", subsystem.getSymbolicName());
@@ -632,6 +637,7 @@ final class SubsystemPermissionCollectio
 	 * @throws SecurityException If this {@code SubsystemPermissionCollection}
 	 *         object has been marked read-only.
 	 */
+	@Override
 	public void add(Permission permission) {
 		if (!(permission instanceof SubsystemPermission)) {
 			throw new IllegalArgumentException("invalid permission: " + permission);
@@ -675,6 +681,7 @@ final class SubsystemPermissionCollectio
 	 *         {@code SubsystemPermission} in this collection, {@code false}
 	 *         otherwise.
 	 */
+	@Override
 	public boolean implies(Permission permission) {
 		if (!(permission instanceof SubsystemPermission)) {
 			return false;
@@ -718,6 +725,7 @@ final class SubsystemPermissionCollectio
 	 * 
 	 * @return Enumeration of all {@code SubsystemPermission} objects.
 	 */
+	@Override
 	public synchronized Enumeration<Permission> elements() {
 		List<Permission> all = new ArrayList<Permission>(permissions.values());
 		return Collections.enumeration(all);
@@ -735,6 +743,7 @@ final class SubsystemPermissionCollectio
 
 	private synchronized void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
 		ObjectInputStream.GetField gfields = in.readFields();
+		@SuppressWarnings("unchecked")
 		HashMap<String, SubsystemPermission> p = (HashMap<String, SubsystemPermission>) gfields.get("permissions", null);
 		permissions = p;
 		all_allowed = gfields.get("all_allowed", false);

Modified: aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/package-info.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/package-info.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/package-info.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/package-info.java Thu Apr 17 14:11:53 2014
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2013). 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.
@@ -15,7 +15,7 @@
  */
 
 /**
- * Subsystem Service Package Version 1.0.
+ * Subsystem Service Package Version 1.1.
  * 
  * <p>
  * Bundles wishing to use this package must list the package in the
@@ -26,14 +26,17 @@
  * <p>
  * Example import for consumers using the API in this package:
  * <p>
- * {@code  Import-Package: org.osgi.service.subsystem; version="[1.0,2.0)"}
+ * {@code  Import-Package: org.osgi.service.subsystem; version="[1.1,2.0)"}
  * <p>
  * Example import for providers implementing the API in this package:
  * <p>
- * {@code  Import-Package: org.osgi.service.subsystem; version="[1.0,1.1)"}
+ * {@code  Import-Package: org.osgi.service.subsystem; version="[1.1,1.2)"}
  * 
- * @version $Id: 3d0a1cfa6351c5c269c23358cfe3cc21403ba453 $
+ * @author $Id: ef9042c42a3fbb135031bf4446e4e0fa0a579d22 $
  */
 
+@Version("1.1")
 package org.osgi.service.subsystem;
 
+import org.osgi.annotation.versioning.Version;
+

Modified: aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/packageinfo
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/packageinfo?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/packageinfo (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-api/src/main/java/org/osgi/service/subsystem/packageinfo Thu Apr 17 14:11:53 2014
@@ -1,14 +1 @@
-/*
- * 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.
- */
-version 1.0
+version 1.1

Modified: aries/branches/subsystemsR6/subsystem/subsystem-bundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-bundle/pom.xml?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-bundle/pom.xml (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-bundle/pom.xml Thu Apr 17 14:11:53 2014
@@ -29,7 +29,7 @@
     <artifactId>org.apache.aries.subsystem</artifactId>
     <packaging>bundle</packaging>
     <name>Apache Aries Subsystems Bundle</name>
-    <version>1.0.1-SNAPSHOT</version>
+    <version>1.1.0-SNAPSHOT</version>
     <description>This is a standalone bundle to support Aries Subsystems.</description>
 
      <scm>
@@ -43,14 +43,14 @@
             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)",
+    		org.osgi.service.repository;version="[1.0,1.1)",
+    		org.osgi.service.subsystem;version="[1.1,1.2)",
     		*
     	</aries.osgi.import>
         <aries.osgi.export.pkg>
-        	org.apache.aries.subsystem;version="1.0",
+        	org.apache.aries.subsystem;version="1.1",
         	org.osgi.service.repository;version="1.0",
-            org.osgi.service.subsystem;version="1.0"
+            org.osgi.service.subsystem;version="1.1"
         </aries.osgi.export.pkg>
         <aries.osgi.private.pkg>
             org.apache.aries.subsystem.*
@@ -61,12 +61,12 @@
         <dependency>
             <groupId>org.apache.aries.subsystem</groupId>
             <artifactId>org.apache.aries.subsystem.api</artifactId>
-            <version>1.0.0</version>
+            <version>1.1.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.subsystem</groupId>
             <artifactId>org.apache.aries.subsystem.core</artifactId>
-            <version>1.0.0</version>
+            <version>1.0.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries</groupId>
@@ -116,7 +116,7 @@
         <dependency>
             <groupId>org.eclipse</groupId>
             <artifactId>org.eclipse.osgi</artifactId>
-            <version>3.8.0.v20120529-1548</version>
+            <version>3.10.0.v20131210-2136</version>
         </dependency>
     </dependencies>
     

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/pom.xml?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/pom.xml (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/pom.xml Thu Apr 17 14:11:53 2014
@@ -43,9 +43,8 @@
             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)",
-    		org.apache.aries.subsystem;version="[1.0,2)",
+    		org.osgi.service.subsystem;version="[1.1,1.2)",
+    		org.apache.aries.subsystem;version="[1.1,1.2)",
     		*
     	</aries.osgi.import>
         <aries.osgi.export.pkg />
@@ -58,7 +57,7 @@
     	<dependency>
             <groupId>org.apache.aries.subsystem</groupId>
             <artifactId>org.apache.aries.subsystem.api</artifactId>
-            <version>1.0.0</version>
+            <version>1.1.0-SNAPSHOT</version>
             <exclusions>
             	<exclusion>
             		<groupId>org.osgi</groupId>
@@ -102,7 +101,7 @@
     	<dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
-            <version>5.0.0</version>
+            <version>6.0.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Added: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageHeader.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageHeader.java?rev=1588265&view=auto
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageHeader.java (added)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageHeader.java Thu Apr 17 14:11:53 2014
@@ -0,0 +1,210 @@
+/*
+ * 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.apache.aries.subsystem.core.archive;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.osgi.framework.Constants;
+import org.osgi.framework.namespace.PackageNamespace;
+import org.osgi.resource.Resource;
+
+public class DynamicImportPackageHeader implements RequirementHeader<DynamicImportPackageHeader.Clause> {
+	public static class Clause implements org.apache.aries.subsystem.core.archive.Clause {
+		private static final String REGEX1 = '(' + Grammar.WILDCARD_NAMES + ")(?=;|\\z)";
+		private static final String REGEX2 = '(' + Grammar.PARAMETER + ")(?=;|\\z)";
+		private static final Pattern PATTERN1 = Pattern.compile(REGEX1);
+		private static final Pattern PATTERN2 = Pattern.compile(REGEX2);
+
+		private static void fillInDefaults(Map<String, Parameter> parameters) {
+			Parameter parameter = parameters.get(Constants.VERSION_ATTRIBUTE);
+			if (parameter == null)
+				parameters.put(Constants.VERSION_ATTRIBUTE, new VersionRangeAttribute());
+		}
+		
+		private final Map<String, Parameter> myParameters = new HashMap<String, Parameter>();
+		private final String myPath;
+		
+		public Clause(String clause) {
+			Matcher matcher = PATTERN1.matcher(clause);
+			if (matcher.find())
+				myPath = matcher.group().replaceAll("\\s", "");
+			else
+				throw new IllegalArgumentException("Invalid " + Constants.IMPORT_PACKAGE + " header clause: " + clause);
+			matcher.usePattern(PATTERN2);
+			while (matcher.find()) {
+				Parameter parameter = ParameterFactory.create(matcher.group());
+				// TODO Revisit the following fix.
+				// All version attributes on an ImportPackage header are ranges. The ParameterFactory will return
+				// a VersionAttribute when the value is a single version (e.g., version=1.0.0). This causes a
+				// ClassCastException in getVersionRangeAttribute().
+				if (parameter instanceof VersionAttribute)
+					parameter = new VersionRangeAttribute(String.valueOf(parameter.getValue()));
+				myParameters.put(parameter.getName(), parameter);
+			}
+			fillInDefaults(myParameters);
+		}
+		
+		@Override
+		public Attribute getAttribute(String name) {
+			Parameter result = myParameters.get(name);
+			if (result instanceof Attribute) {
+				return (Attribute)result;
+			}
+			return null;
+		}
+		
+		@Override
+		public Collection<Attribute> getAttributes() {
+			ArrayList<Attribute> attributes = new ArrayList<Attribute>(myParameters.size());
+			for (Parameter parameter : myParameters.values()) {
+				if (parameter instanceof Attribute) {
+					attributes.add((Attribute)parameter);
+				}
+			}
+			attributes.trimToSize();
+			return attributes;
+		}
+		
+		@Override
+		public Directive getDirective(String name) {
+			Parameter result = myParameters.get(name);
+			if (result instanceof Directive) {
+				return (Directive)result;
+			}
+			return null;
+		}
+		
+		@Override
+		public Collection<Directive> getDirectives() {
+			ArrayList<Directive> directives = new ArrayList<Directive>(myParameters.size());
+			for (Parameter parameter : myParameters.values()) {
+				if (parameter instanceof Directive) {
+					directives.add((Directive)parameter);
+				}
+			}
+			directives.trimToSize();
+			return directives;
+		}
+		
+		public Collection<String> getPackageNames() {
+			return Arrays.asList(myPath.split(";"));
+		}
+		
+		@Override
+		public Parameter getParameter(String name) {
+			return myParameters.get(name);
+		}
+		
+		@Override
+		public Collection<Parameter> getParameters() {
+			return Collections.unmodifiableCollection(myParameters.values());
+		}
+		
+		@Override
+		public String getPath() {
+			return myPath;
+		}
+		
+		public VersionRangeAttribute getVersionRangeAttribute() {
+			return (VersionRangeAttribute)myParameters.get(Constants.VERSION_ATTRIBUTE);
+		}
+		
+		public List<DynamicImportPackageRequirement> toRequirements(Resource resource) {
+			Collection<String> pkgs = getPackageNames();
+			List<DynamicImportPackageRequirement> result = new ArrayList<DynamicImportPackageRequirement>(pkgs.size());
+			for (String pkg : pkgs) {
+				result.add(new DynamicImportPackageRequirement(pkg, this, resource));
+			}
+			return result;
+		}
+		
+		@Override
+		public String toString() {
+			StringBuilder builder = new StringBuilder()
+					.append(getPath());
+			for (Parameter parameter : getParameters()) {
+				builder.append(';').append(parameter);
+			}
+			return builder.toString();
+		}
+	}
+	
+	public static final String ATTRIBUTE_BUNDLE_SYMBOLICNAME = PackageNamespace.CAPABILITY_BUNDLE_SYMBOLICNAME_ATTRIBUTE;
+	public static final String ATTRIBUTE_BUNDLE_VERSION = PackageNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE;
+	public static final String ATTRIBUTE_VERSION = PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE;
+	public static final String NAME = Constants.DYNAMICIMPORT_PACKAGE;
+	
+	private static Collection<Clause> processHeader(String header) {
+		Set<Clause> clauses = new HashSet<Clause>();
+		for (String clause : new ClauseTokenizer(header).getClauses())
+			clauses.add(new Clause(clause));
+		return clauses;
+	}
+	
+	private final Set<Clause> clauses;
+	
+	public DynamicImportPackageHeader(Collection<Clause> clauses) {
+		if (clauses.isEmpty())
+			throw new IllegalArgumentException("A DynamicImport-Package header must have at least one clause");
+		this.clauses = new HashSet<Clause>(clauses);
+	}
+	
+	public DynamicImportPackageHeader(String header) {
+		this(processHeader(header));
+	}
+	
+	public Collection<DynamicImportPackageHeader.Clause> getClauses() {
+		return Collections.unmodifiableSet(clauses);
+	}
+
+	public String getName() {
+		return Constants.IMPORT_PACKAGE;
+	}
+	
+	@Override
+	public String getValue() {
+		return toString();
+	}
+	
+	@Override
+	public List<DynamicImportPackageRequirement> toRequirements(Resource resource) {
+		Collection<Clause> clauses = getClauses();
+		List<DynamicImportPackageRequirement> result = new ArrayList<DynamicImportPackageRequirement>(clauses.size());
+		for (Clause clause : clauses) {
+			result.addAll(clause.toRequirements(resource));
+		}
+		return result;
+	}
+	
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		for (Clause clause : getClauses()) {
+			builder.append(clause).append(',');
+		}
+		// Remove the trailing comma. Note at least one clause is guaranteed to exist.
+		builder.deleteCharAt(builder.length() - 1);
+		return builder.toString();
+	}
+}

Propchange: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageHeader.java
------------------------------------------------------------------------------
    svn:executable = *

Added: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageRequirement.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageRequirement.java?rev=1588265&view=auto
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageRequirement.java (added)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageRequirement.java Thu Apr 17 14:11:53 2014
@@ -0,0 +1,72 @@
+/*
+ * 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.apache.aries.subsystem.core.archive;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.aries.subsystem.core.internal.AbstractRequirement;
+import org.osgi.framework.namespace.PackageNamespace;
+import org.osgi.resource.Resource;
+
+public class DynamicImportPackageRequirement extends AbstractRequirement {
+	public static final String DIRECTIVE_FILTER = PackageNamespace.REQUIREMENT_FILTER_DIRECTIVE;
+	public static final String NAMESPACE = PackageNamespace.PACKAGE_NAMESPACE;
+	
+	private final Map<String, String> directives;
+	private final String packageName;
+	private final Resource resource;
+	
+	public DynamicImportPackageRequirement(String pkg, DynamicImportPackageHeader.Clause clause, Resource resource) {
+		packageName = pkg;
+		Collection<Directive> clauseDirectives = clause.getDirectives();
+		directives = new HashMap<String, String>(clauseDirectives.size() + 1);
+		for (Directive directive : clauseDirectives)
+			directives.put(directive.getName(), directive.getValue());
+		StringBuilder filter = new StringBuilder("(&(").append(NAMESPACE)
+				.append('=').append(pkg).append(')');
+		VersionRangeAttribute versionRange = clause.getVersionRangeAttribute();
+		if (versionRange != null) {
+			versionRange.appendToFilter(filter);
+		}
+		directives.put(DIRECTIVE_FILTER, filter.append(')').toString());
+		this.resource = resource;
+	}
+	
+	@Override
+	public Map<String, Object> getAttributes() {
+		return Collections.emptyMap();
+	}
+
+	@Override
+	public Map<String, String> getDirectives() {
+		return Collections.unmodifiableMap(directives);
+	}
+
+	@Override
+	public String getNamespace() {
+		return NAMESPACE;
+	}
+	
+	public String getPackageName() {
+		return packageName;
+	}
+
+	@Override
+	public Resource getResource() {
+		return resource;
+	}
+}

Propchange: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/DynamicImportPackageRequirement.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/Grammar.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/Grammar.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/Grammar.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/Grammar.java Thu Apr 17 14:11:53 2014
@@ -165,4 +165,9 @@ public interface Grammar {
 	public static final String CEILING = VERSION;
 	public static final String INTERVAL = "[\\[\\(]" + FLOOR + ',' + CEILING + "[\\[\\)]";
 	public static final String VERSIONRANGE = INTERVAL + '|' + ATLEAST;
+	
+	public static final String WILDCARD_NAME = PACKAGENAME + '|' + PACKAGENAME + "\\.\\*" + "|\\*";
+	public static final String WILDCARD_NAMES = WILDCARD_NAME + "\\s*(?:\\;\\s*" + WILDCARD_NAME + ")*";
+	public static final String DYNAMIC_DESCRIPTION = WILDCARD_NAMES + "(?:;\\s*(?:" + PARAMETER + "))*";
+	public static final String DYNAMICIMPORT_PACKAGE = DYNAMIC_DESCRIPTION + "(?:\\,\\s*" + DYNAMIC_DESCRIPTION + ")*";
 }

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/HeaderFactory.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/HeaderFactory.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/HeaderFactory.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/HeaderFactory.java Thu Apr 17 14:11:53 2014
@@ -115,6 +115,8 @@ public class HeaderFactory {
 			return new AriesSubsystemParentsHeader(value);
 		if (BundleRequiredExecutionEnvironmentHeader.NAME.equals(name))
 			return new BundleRequiredExecutionEnvironmentHeader(value);
+		if (SubsystemLocalizationHeader.NAME.equals(name))
+			return new SubsystemLocalizationHeader(value);
 		return new GenericHeader(name, value);
 			
 	}

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemExportServiceCapability.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemExportServiceCapability.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemExportServiceCapability.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemExportServiceCapability.java Thu Apr 17 14:11:53 2014
@@ -19,13 +19,13 @@ import java.util.Map;
 
 import org.apache.aries.subsystem.core.internal.AbstractCapability;
 import org.osgi.framework.Constants;
+import org.osgi.namespace.service.ServiceNamespace;
 import org.osgi.resource.Namespace;
 import org.osgi.resource.Resource;
 
 public class SubsystemExportServiceCapability extends AbstractCapability {
 	public static final String DIRECTIVE_FILTER = Namespace.REQUIREMENT_FILTER_DIRECTIVE;
-	// TODO Replace value with ServiceNamspace.SERVICE_NAMESPACE constant when available.
-	public static final String NAMESPACE = "osgi.service";
+	public static final String NAMESPACE = ServiceNamespace.SERVICE_NAMESPACE;
 	
 	private final Map<String, Object> attributes = new HashMap<String, Object>();
 	private final Map<String, String> directives = new HashMap<String, String>();
@@ -36,7 +36,7 @@ public class SubsystemExportServiceCapab
 				.append(Constants.OBJECTCLASS).append('=')
 				.append(clause.getObjectClass()).append(')');
 		Directive filter = clause
-				.getDirective(SubsystemImportServiceHeader.Clause.DIRECTIVE_FILTER);
+				.getDirective(SubsystemExportServiceHeader.Clause.DIRECTIVE_FILTER);
 		if (filter != null)
 			builder.append(filter.getValue());
 		directives.put(DIRECTIVE_FILTER, builder.append(')').toString());

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemImportServiceRequirement.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemImportServiceRequirement.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemImportServiceRequirement.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemImportServiceRequirement.java Thu Apr 17 14:11:53 2014
@@ -18,23 +18,36 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.aries.subsystem.core.internal.AbstractRequirement;
+import org.osgi.framework.Constants;
+import org.osgi.namespace.service.ServiceNamespace;
 import org.osgi.resource.Namespace;
 import org.osgi.resource.Resource;
 
 public class SubsystemImportServiceRequirement extends AbstractRequirement {
 	public static final String DIRECTIVE_FILTER = Namespace.REQUIREMENT_FILTER_DIRECTIVE;
-	// TODO Replace value with ServiceNamspace.SERVICE_NAMESPACE constant when available.
-	public static final String NAMESPACE = "osgi.service";
+	public static final String NAMESPACE = ServiceNamespace.SERVICE_NAMESPACE;
 	
 	private final Map<String, String> directives = new HashMap<String, String>(1);
 	private final Resource resource;
 	
 	public SubsystemImportServiceRequirement(
 			SubsystemImportServiceHeader.Clause clause, Resource resource) {
-		Directive filter = clause
-				.getDirective(SubsystemImportServiceHeader.Clause.DIRECTIVE_FILTER);
-		if (filter != null)
-			directives.put(DIRECTIVE_FILTER, filter.getValue());
+		boolean appendObjectClass = !ServiceNamespace.SERVICE_NAMESPACE.equals(clause.getPath());
+		StringBuilder builder = new StringBuilder();
+		if (appendObjectClass) {
+			builder.append("(&(").append(Constants.OBJECTCLASS).append('=').append(clause.getPath()).append(')');
+		}
+		Directive filter = clause.getDirective(SubsystemExportServiceHeader.Clause.DIRECTIVE_FILTER);
+		if (filter != null) {
+			builder.append(filter.getValue());
+		}
+		if (appendObjectClass) {
+			builder.append(')');
+		}
+		String filterStr = builder.toString();
+		if (!filterStr.isEmpty()) {
+			directives.put(DIRECTIVE_FILTER, filterStr);
+		}
 		this.resource = resource;
 	}
 

Added: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemLocalizationHeader.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemLocalizationHeader.java?rev=1588265&view=auto
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemLocalizationHeader.java (added)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemLocalizationHeader.java Thu Apr 17 14:11:53 2014
@@ -0,0 +1,45 @@
+/*
+ * 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.apache.aries.subsystem.core.archive;
+
+import org.osgi.service.subsystem.SubsystemConstants;
+
+public class SubsystemLocalizationHeader extends AbstractHeader {
+	public static final String DEFAULT_VALUE = "OSGI-INF/l10n/subsystem";
+	public static final String NAME = SubsystemConstants.SUBSYSTEM_LOCALIZATION;
+	
+	public static final SubsystemLocalizationHeader DEFAULT = new SubsystemLocalizationHeader();
+	
+	private final String baseFileName;
+	private final String directoryName;
+	
+	public SubsystemLocalizationHeader() {
+		this(DEFAULT_VALUE);
+	}
+
+	public SubsystemLocalizationHeader(String value) {
+		super(NAME, value);
+		int index = value.lastIndexOf('/');
+		baseFileName = index == -1 ? value : value.substring(index + 1);
+		directoryName = index == -1 ? null : value.substring(0, index + 1);
+	}
+	
+	public String getBaseFileName() {
+		return baseFileName;
+	}
+	
+	public String getDirectoryName() {
+		return directoryName;
+	}
+}

Propchange: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemLocalizationHeader.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemManifest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemManifest.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemManifest.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/archive/SubsystemManifest.java Thu Apr 17 14:11:53 2014
@@ -109,6 +109,7 @@ public class SubsystemManifest {
 	public static final String SUBSYSTEM_DESCRIPTION = SubsystemConstants.SUBSYSTEM_DESCRIPTION;
 	public static final String SUBSYSTEM_EXPORTSERVICE = SubsystemConstants.SUBSYSTEM_EXPORTSERVICE;
 	public static final String SUBSYSTEM_IMPORTSERVICE = SubsystemConstants.SUBSYSTEM_IMPORTSERVICE;
+	public static final String SUBSYTEM_LOCALIZATION = SubsystemConstants.SUBSYSTEM_LOCALIZATION;
 	public static final String SUBSYSTEM_MANIFESTVERSION = SubsystemConstants.SUBSYSTEM_MANIFESTVERSION;
 	public static final String SUBSYSTEM_NAME = SubsystemConstants.SUBSYSTEM_NAME;
 	public static final String SUBSYSTEM_SYMBOLICNAME = SubsystemConstants.SUBSYSTEM_SYMBOLICNAME;
@@ -132,6 +133,9 @@ public class SubsystemManifest {
 		header = headers.get(SUBSYSTEM_TYPE);
 		if (header == null)
 			headers.put(SUBSYSTEM_TYPE, SubsystemTypeHeader.DEFAULT);
+		header = headers.get(SUBSYTEM_LOCALIZATION);
+		if (header == null)
+			headers.put(SUBSYTEM_LOCALIZATION, SubsystemLocalizationHeader.DEFAULT);
 	}
 	
 	private final Map<String, Header<?>> headers;
@@ -229,6 +233,10 @@ public class SubsystemManifest {
 		return (SubsystemImportServiceHeader)getHeaders().get(SUBSYSTEM_IMPORTSERVICE);
 	}
 	
+	public SubsystemLocalizationHeader getSubsystemLocalizationHeader() {
+		return (SubsystemLocalizationHeader)getHeaders().get(SUBSYTEM_LOCALIZATION);
+	}
+	
 	public SubsystemSymbolicNameHeader getSubsystemSymbolicNameHeader() {
 		return (SubsystemSymbolicNameHeader)getHeaders().get(SUBSYSTEM_SYMBOLICNAME);
 	}

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/Activator.java Thu Apr 17 14:11:53 2014
@@ -35,7 +35,6 @@ import org.osgi.framework.ServiceRegistr
 import org.osgi.framework.hooks.bundle.EventHook;
 import org.osgi.framework.hooks.resolver.ResolverHookFactory;
 import org.osgi.service.coordinator.Coordinator;
-import org.osgi.service.repository.Repository;
 import org.osgi.service.resolver.Resolver;
 import org.osgi.util.tracker.ServiceTracker;
 import org.osgi.util.tracker.ServiceTrackerCustomizer;
@@ -78,7 +77,6 @@ public class Activator implements Bundle
 	private volatile Subsystems subsystems;
 	
 	private final Collection<ServiceRegistration<?>> registrations = new HashSet<ServiceRegistration<?>>();
-	private final Collection<Repository> repositories = Collections.synchronizedSet(new HashSet<Repository>());
 	private final Collection<IDirectoryFinder> finders = Collections.synchronizedSet(new HashSet<IDirectoryFinder>());
 	
 	public BundleContext getBundleContext() {
@@ -97,10 +95,6 @@ public class Activator implements Bundle
 		return regionDigraph;
 	}
 	
-	public Collection<Repository> getRepositories() {
-		return Collections.unmodifiableCollection(repositories);
-	}
-	
 	public Collection<IDirectoryFinder> getIDirectoryFinders() {
 		return Collections.unmodifiableCollection(finders);
 	}
@@ -120,7 +114,7 @@ public class Activator implements Bundle
 		return result;
 	}
 	
-	public Repository getSystemRepository() {
+	public org.apache.aries.subsystem.core.repository.Repository getSystemRepository() {
 		return new SystemRepository(getSubsystems().getRootSubsystem());
 	}
 
@@ -155,6 +149,7 @@ public class Activator implements Bundle
 		BasicSubsystem root = subsystems.getRootSubsystem();
 		bundleEventHook.activate();
 		root.start();
+		registerWovenClassListener();
 	}
 	
 	private void deactivate() {
@@ -199,7 +194,7 @@ public class Activator implements Bundle
 				.append(org.osgi.framework.Constants.OBJECTCLASS).append('=')
 				.append(Resolver.class.getName()).append(")(")
 				.append(org.osgi.framework.Constants.OBJECTCLASS).append('=')
-				.append(Repository.class.getName()).append(")(")
+				.append("org.osgi.service.repository.Repository").append(")(")
 				.append(org.osgi.framework.Constants.OBJECTCLASS).append('=')
 				.append(ModelledResourceManager.class.getName()).append(")(")
 				.append(org.osgi.framework.Constants.OBJECTCLASS).append('=')
@@ -225,6 +220,14 @@ public class Activator implements Bundle
 		registrations.add(bundleContext.registerService(EventHook.class, bundleEventHook, properties));
 	}
 	
+	private void registerWovenClassListener() {
+		registrations.add(
+				bundleContext.registerService(
+						org.osgi.framework.hooks.weaving.WovenClassListener.class,
+						new WovenClassListener(bundleContext, subsystems),
+						null));
+	}
+	
 	/* Begin ServiceTrackerCustomizer methods */
 
 	@Override
@@ -233,8 +236,6 @@ public class Activator implements Bundle
 		// Use all of each type of the following services.
 		if (service instanceof IDirectoryFinder)
 			finders.add((IDirectoryFinder) service);
-		else if (service instanceof Repository)
-			repositories.add((Repository) service);
 		// Use only one of each type of the following services.
 		else if (service instanceof Coordinator && coordinator == null)
 			coordinator = (Coordinator) service;
@@ -244,6 +245,8 @@ public class Activator implements Bundle
 			resolver = (Resolver) service;
 		else if (service instanceof ModelledResourceManager && modelledResourceManager == null)
 			modelledResourceManager = (ModelledResourceManager) service;
+		else
+			service = null;
 		// Activation is harmless if already active or all required services
 		// have not yet been found.
 		activate();
@@ -292,8 +295,6 @@ public class Activator implements Bundle
 		}
 		else if (service instanceof IDirectoryFinder)
 			finders.remove(service);
-		else
-			repositories.remove(service);
 	}
 	
 	/* End ServiceTrackerCustomizer methods */

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BasicSubsystem.java Thu Apr 17 14:11:53 2014
@@ -77,6 +77,10 @@ public class BasicSubsystem implements R
 	private final IDirectory directory;
 	
 	public BasicSubsystem(SubsystemResource resource) throws URISyntaxException, IOException, BundleException, InvalidSyntaxException {
+		this(resource, null);
+	}
+	
+	public BasicSubsystem(SubsystemResource resource, InputStream deploymentManifest) throws URISyntaxException, IOException, BundleException, InvalidSyntaxException {
 		this.resource = resource;
 		final File file = new File(Activator.getInstance().getBundleContext().getDataFile(""), Long.toString(resource.getId()));
 		file.mkdirs();
@@ -99,7 +103,7 @@ public class BasicSubsystem implements R
 		SubsystemManifestValidator.validate(this, getSubsystemManifest());
 		setDeploymentManifest(new DeploymentManifest.Builder()
 				.manifest(resource.getSubsystemManifest())
-				.manifest(resource.getDeploymentManifest())
+				.manifest(deploymentManifest == null ? resource.getDeploymentManifest() : new DeploymentManifest(deploymentManifest))
 				.location(resource.getLocation())
 				.autostart(false)
 				.id(resource.getId())
@@ -107,6 +111,7 @@ public class BasicSubsystem implements R
 				.region(resource.getRegion().getName())
 				.state(State.INSTALLING)
 				.build());
+		setTranslations();
 	}
 	
 	public BasicSubsystem(File file) throws IOException, URISyntaxException, ResolutionException {
@@ -194,7 +199,7 @@ public class BasicSubsystem implements R
 	@Override
 	public Map<String, String> getSubsystemHeaders(Locale locale) {
 		SecurityManager.checkMetadataPermission(this);
-		return AccessController.doPrivileged(new GetSubsystemHeadersAction(this));
+		return AccessController.doPrivileged(new GetSubsystemHeadersAction(this, locale));
 	}
 
 	@Override
@@ -254,20 +259,8 @@ public class BasicSubsystem implements R
 	}
 
 	@Override
-	public AriesSubsystem install(String location, final InputStream content) {
-		try {
-			return install(location, content == null ? null : 
-				AccessController.doPrivileged(new PrivilegedAction<IDirectory>() {
-					@Override
-					public IDirectory run() {
-						return FileSystem.getFSRoot(content);
-					}
-				}));
-		}
-		finally {
-			// This method must guarantee the content input stream was closed.
-			IOUtils.close(content);
-		}
+	public AriesSubsystem install(String location, InputStream content) {
+		return install(location, content, null);
 	}
 
 	@Override
@@ -618,7 +611,17 @@ public class BasicSubsystem implements R
 
 	@Override
 	public AriesSubsystem install(String location, IDirectory content) {
-		return AccessController.doPrivileged(new InstallAction(location, content, this, AccessController.getContext()));
+		return install(location, content, null);
+	}
+	
+	@Override
+	public AriesSubsystem install(String location, IDirectory content, InputStream deploymentManifest) {
+		try {
+			return AccessController.doPrivileged(new InstallAction(location, content, this, AccessController.getContext(), deploymentManifest));
+		}
+		finally {
+			IOUtils.close(deploymentManifest);
+		}
 	}
 
 	private static class SaveManifestParticipant implements Participant {
@@ -648,4 +651,38 @@ public class BasicSubsystem implements R
 		}
 		
 	}
+
+	@Override
+	public Map<String, String> getDeploymentHeaders() {
+		SecurityManager.checkMetadataPermission(this);
+		return AccessController.doPrivileged(new GetDeploymentHeadersAction(this));
+	}
+
+	@Override
+	public AriesSubsystem install(String location, final InputStream content, InputStream deploymentManifest) {
+		try {
+			return install(location, content == null ? null : 
+				AccessController.doPrivileged(new PrivilegedAction<IDirectory>() {
+					@Override
+					public IDirectory run() {
+						return FileSystem.getFSRoot(content);
+					}
+				}),
+				deploymentManifest);
+		}
+		finally {
+			// This method must guarantee the content input stream was closed.
+			IOUtils.close(content);
+		}
+	}
+	
+	private void setTranslations() throws IOException {
+		String directoryName = getSubsystemManifest().getSubsystemLocalizationHeader().getDirectoryName();
+		File file = directoryName == null ? getDirectory() : new File(getDirectory(), directoryName);
+		if (!file.exists())
+			file.mkdirs();
+		for (TranslationFile translation : getResource().getTranslations()) {
+			translation.write(file);
+		}
+	}
 }

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResource.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResource.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResource.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResource.java Thu Apr 17 14:11:53 2014
@@ -52,10 +52,9 @@ import org.osgi.resource.Capability;
 import org.osgi.resource.Namespace;
 import org.osgi.resource.Requirement;
 import org.osgi.resource.Resource;
-import org.osgi.service.repository.RepositoryContent;
 import org.osgi.service.subsystem.SubsystemException;
 
-public class BundleResource implements Resource, RepositoryContent {
+public class BundleResource implements Resource, org.apache.aries.subsystem.core.repository.RepositoryContent {
 	private static BundleManifest computeManifest(IDirectory directory) {
 		return new BundleManifest(org.apache.aries.util.manifest.BundleManifest
 				.fromBundle(directory)
@@ -230,14 +229,24 @@ public class BundleResource implements R
 		// to services.
 		computeRequirementsOtherThanService();
 		computeCapabilitiesOtherThanService();
+		// OSGi RFC 201 for R6: The presence of any Require/Provide-Capability
+		// clauses in the osgi.service namespace overrides any service related
+		// requirements or capabilities that might have been found by other
+		// means.
+		boolean computeServiceRequirements = getRequirements(ServiceNamespace.SERVICE_NAMESPACE).isEmpty();
+		boolean computeServiceCapabilities = getCapabilities(ServiceNamespace.SERVICE_NAMESPACE).isEmpty();
+		if (!(computeServiceCapabilities || computeServiceRequirements))
+			return;
 		// Compute service requirements and capabilities if the optional
 		// ModelledResourceManager service is present.
 		ModelledResourceManager manager = getModelledResourceManager();
 		if (manager == null)
 			return;
 		ParsedServiceElements elements = manager.getServiceElements(directory);
-		computeOsgiServiceRequirements(elements.getReferences());
-		computeOsgiServiceCapabilities(elements.getServices());
+		if (computeServiceRequirements)
+			computeOsgiServiceRequirements(elements.getReferences());
+		if (computeServiceCapabilities)
+			computeOsgiServiceCapabilities(elements.getServices());
 	}
 	
 	private void computeRequirementsOtherThanService() {

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleResourceInstaller.java Thu Apr 17 14:11:53 2014
@@ -33,7 +33,6 @@ import org.osgi.resource.Requirement;
 import org.osgi.resource.Resource;
 import org.osgi.service.coordinator.Coordination;
 import org.osgi.service.coordinator.Participant;
-import org.osgi.service.repository.RepositoryContent;
 import org.osgi.service.subsystem.SubsystemException;
 
 public class BundleResourceInstaller extends ResourceInstaller {
@@ -175,16 +174,21 @@ public class BundleResourceInstaller ext
 			revision = (BundleRevision)resource;
 		else {
 			ThreadLocalSubsystem.set(provisionTo);
-			revision = installBundle();
+			try {
+				revision = installBundle();
+			}
+			catch (Exception e) {
+				throw new SubsystemException(e);
+			}
 		}
 		addReference(revision);
 		addConstituent(new BundleConstituent(resource, revision));
 		return revision;
 	}
 	
-	private BundleRevision installBundle() {
+	private BundleRevision installBundle() throws Exception {
 		final Bundle bundle;
-		InputStream is = ((RepositoryContent)resource).getContent();
+		InputStream is = (InputStream)resource.getClass().getMethod("getContent").invoke(resource);
 		try {
 			bundle = provisionTo.getRegion().installBundleAtLocation(getLocation(), is);
 		}

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/BundleRevisionResource.java Thu Apr 17 14:11:53 2014
@@ -52,9 +52,13 @@ public class BundleRevisionResource impl
 			result.addAll(sCaps);
 			return Collections.unmodifiableList(result);
 		}
-		if (ServiceNamespace.SERVICE_NAMESPACE.equals(namespace))
-			return Collections.unmodifiableList(computeServiceCapabilities());
-		return revision.getCapabilities(namespace);
+		List<Capability> result = revision.getCapabilities(namespace);
+		// OSGi RFC 201 for R6: The presence of any Provide-Capability clauses
+		// in the osgi.service namespace overrides any service related
+		// capabilities that might have been found by other means.
+		if (result.isEmpty() && ServiceNamespace.SERVICE_NAMESPACE.equals(namespace))
+			result = Collections.unmodifiableList(computeServiceCapabilities());
+		return result;
 	}
 
 	@Override
@@ -67,9 +71,13 @@ public class BundleRevisionResource impl
 			result.addAll(sReqs);
 			return Collections.unmodifiableList(result);
 		}
-		if (ServiceNamespace.SERVICE_NAMESPACE.equals(namespace))
-			return Collections.unmodifiableList(computeServiceRequirements());
-		return revision.getRequirements(namespace);
+		// OSGi RFC 201 for R6: The presence of any Require-Capability clauses
+		// in the osgi.service namespace overrides any service related
+		// requirements that might have been found by other means.
+		List<Requirement> result = revision.getRequirements(namespace);
+		if (result.isEmpty() && ServiceNamespace.SERVICE_NAMESPACE.equals(namespace))
+			result = Collections.unmodifiableList(computeServiceRequirements());
+		return result;
 	}
 	
 	private ParsedServiceElements computeParsedServiceElements() {

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/CompositeRepository.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/CompositeRepository.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/CompositeRepository.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/CompositeRepository.java Thu Apr 17 14:11:53 2014
@@ -23,22 +23,21 @@ import java.util.Set;
 
 import org.osgi.resource.Capability;
 import org.osgi.resource.Requirement;
-import org.osgi.service.repository.Repository;
 
-public class CompositeRepository implements Repository {
-	private final Collection<Repository> repositories;
+public class CompositeRepository implements org.apache.aries.subsystem.core.repository.Repository {
+	private final Collection<org.apache.aries.subsystem.core.repository.Repository> repositories;
 	
-	public CompositeRepository(Repository...repositories) {
+	public CompositeRepository(org.apache.aries.subsystem.core.repository.Repository...repositories) {
 		this(Arrays.asList(repositories));
 	}
 	
-	public CompositeRepository(Collection<Repository> repositories) {
+	public CompositeRepository(Collection<org.apache.aries.subsystem.core.repository.Repository> repositories) {
 		this.repositories = repositories;
 	}
 	
 	public Collection<Capability> findProviders(Requirement requirement) {
 		Set<Capability> result = new HashSet<Capability>();
-		for (Repository repository : repositories) {
+		for (org.apache.aries.subsystem.core.repository.Repository repository : repositories) {
 			Map<Requirement, Collection<Capability>> map = repository.findProviders(Collections.singleton(requirement));
 			Collection<Capability> capabilities = map.get(requirement);
 			if (capabilities == null)

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ContentRepository.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ContentRepository.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ContentRepository.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/ContentRepository.java Thu Apr 17 14:11:53 2014
@@ -23,9 +23,8 @@ import java.util.Map;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Requirement;
 import org.osgi.resource.Resource;
-import org.osgi.service.repository.Repository;
 
-public class ContentRepository implements Repository {
+public class ContentRepository implements org.apache.aries.subsystem.core.repository.Repository {
 	private static void findContent(Requirement requirement, Collection<Capability> capabilities, Collection<Resource> resources) {
 		for (Resource resource : resources)
 			for (Capability capability : resource.getCapabilities(requirement.getNamespace()))

Modified: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/DependencyCalculator.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/DependencyCalculator.java?rev=1588265&r1=1588264&r2=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/DependencyCalculator.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/DependencyCalculator.java Thu Apr 17 14:11:53 2014
@@ -79,7 +79,7 @@ public class DependencyCalculator {
 		}
 	}
 
-	private static class MissingCapability extends AbstractCapability {
+	static class MissingCapability extends AbstractCapability {
 		private static class Resource implements org.osgi.resource.Resource {
 			public static final Resource INSTANCE = new Resource();
 			

Copied: aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetDeploymentHeadersAction.java (from r1536385, aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java)
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetDeploymentHeadersAction.java?p2=aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetDeploymentHeadersAction.java&p1=aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java&r1=1536385&r2=1588265&rev=1588265&view=diff
==============================================================================
--- aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetSubsystemHeadersAction.java (original)
+++ aries/branches/subsystemsR6/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetDeploymentHeadersAction.java Thu Apr 17 14:11:53 2014
@@ -20,16 +20,16 @@ import java.util.Map.Entry;
 
 import org.apache.aries.subsystem.core.archive.Header;
 
-public class GetSubsystemHeadersAction implements PrivilegedAction<Map<String, String>> {
+public class GetDeploymentHeadersAction implements PrivilegedAction<Map<String, String>> {
 	private final BasicSubsystem subsystem;
 	
-	public GetSubsystemHeadersAction(BasicSubsystem subsystem) {
+	public GetDeploymentHeadersAction(BasicSubsystem subsystem) {
 		this.subsystem = subsystem;
 	}
 	
 	@Override
 	public Map<String, String> run() {
-		Map<String, Header<?>> headers = subsystem.getSubsystemManifest().getHeaders();
+		Map<String, Header<?>> headers = subsystem.getDeploymentManifest().getHeaders();
 		Map<String, String> result = new HashMap<String, String>(headers.size());
 		for (Entry<String, Header<?>> entry: headers.entrySet()) {
 			Header<?> value = entry.getValue();
@@ -37,5 +37,4 @@ public class GetSubsystemHeadersAction i
 		}
 		return result;
 	}
-
 }



Mime
View raw message