You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:17:06 UTC

[sling-org-apache-sling-settings] annotated tag org.apache.sling.settings-1.3.4 created (now 5f611a3)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.settings-1.3.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-settings.git.


      at 5f611a3  (tag)
 tagging 1e1bf8beb366bc86b367b03c191d6af6347cb0a0 (commit)
      by Carsten Ziegeler
      on Mon Oct 6 18:22:14 2014 +0000

- Log -----------------------------------------------------------------
org.apache.sling.settings-1.3.4
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new e29b17b  SLING-1460 : Move SlingSettingsService to new Settings bundle
     new 2f625ec  SLING-1651 - Integrate RunMode module into new Settings Module SLING-983 - Add sling.properties file to configuration status page
     new fdbf548  SLING-1651 - Integrate RunMode module into new Settings Module SLING-983 - Add sling.properties file to configuration status page
     new 02d570e  Ignore Eclipse files
     new c7ffd13  Don't delete sling id file in engine for compatibility and add a temporary np check
     new fee338d  Delayed activation if engine bundle is available but not started yet.
     new 9381905  Some pom formatting, set export version and make dependencies provided
     new d766e1e  Add site generation properties and Bundle-DocURL manifest header
     new 55a7b4b  [maven-release-plugin] prepare release org.apache.sling.settings-1.0.0
     new 7374c80  [maven-release-plugin] prepare for next development iteration
     new 13ea134  Add README.txt
     new 1c24d3b  SLING-1835 : Remove direct dependency to web console by using new configuration printer support
     new 855b40f  [maven-release-plugin] prepare release org.apache.sling.settings-1.0.2
     new f8f82be  [maven-release-plugin] prepare for next development iteration
     new 305e51c  updating all modules to parent 10-SNAPSHOT in anticipation of emma additions to parent
     new dde5897  Update to recent snapshots
     new c7bd56b  Use latest releases.
     new de1d202  SLING-1970 : Potential deadlock during start of settings service
     new 9897382  SLING-2089 - adding getAbsolutePathWithinSlingHome() method
     new c144627  SLING-2150 : Update plugins to use the latest available versions
     new b1b2847  SLING-2155 : Remove check for Sling Engine bundle
     new 2614e9f  Update to recent snapshot
     new 09f8851  Using latest released parent pom
     new 8e82fb1  SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
     new e535edf  temporarily using snapshots during release vote
     new cdf97c6  using latest releases
     new 50e68a4  [maven-release-plugin] prepare release org.apache.sling.settings-1.1.0
     new a9b604a  [maven-release-plugin] prepare for next development iteration
     new 73a4d66  SLING-2480 : Add config for maven-sling-plugin to m2e configuration
     new a10e502  Remove old scr javadoc annotation
     new dc197cd  Update to latest parent pom
     new 8a358ad  Use released versions
     new 11b3f5c  SLING-2662 :  Enhance run mode handling
     new 4c28623  SLING-2662 :  Enhance run mode handling
     new bbb8a01  SLING-2662 - more readable tests and some additional ones
     new cc7e187  [maven-release-plugin] prepare release org.apache.sling.settings-1.2.0
     new f582fe7  [maven-release-plugin] prepare for next development iteration
     new 4dc89f8  SLING-2662 - test case with empty run modes string
     new 1cb0791  SLING-2673 - close fis stream
     new 3ffd484  SLING-2674 - take new run mode options into account when starting on an older Sling instance
     new 1ae0f68  SLING-2674: SlingSettingsServiceImpl should detect and handle upgrades
     new 7c9f72c  Support portals bridge
     new 7c677f2  SLING-2674 :  SlingSettingsServiceImpl should detect and handle upgrades
     new 6f759e5  [maven-release-plugin] prepare release org.apache.sling.settings-1.2.2
     new 442e5f4  [maven-release-plugin] prepare for next development iteration
     new 63f7ade  Use latest releases and update to new parent pom
     new 6d4543f  Update to latest parent pom and use latest releases in launchpad
     new 5cd294c  Correct reactor pom and update to parent pom 16
     new a3279d2  Update to latest parent pom
     new 2395548  SLING-2976 :  Add support for instance name and description
     new aeb6067  SLING-2976 :  Add support for instance name and description
     new 2b30ad8  [maven-release-plugin] prepare release org.apache.sling.settings-1.3.0
     new 2b35f10  [maven-release-plugin] prepare for next development iteration
     new ce2f298  Update to parent pom 18
     new a716016  Revert to old maven bundle plugin if DynamicImport-Package is used
     new 11b2ccd  SLING-3286 - Remove plugin version overrides from poms
     new a52cf20  SLING-3286 - Remove plugin version overrides from poms
     new 1f53831  Update to parent pom v19
     new dac3466  SLING-3737 : Instance Sling Identifier may be randomly reset on restart. Apply patch from Timothee Maret
     new 26ab368  [maven-release-plugin] prepare release org.apache.sling.settings-1.3.2
     new ca1d3d5  [maven-release-plugin] prepare for next development iteration
     new e11f919  Updated to parent version 20
     new 521ed2b  SLING-3818 - RunModeImplTest.testParseRunModes fails under Java 8 : Parsed runModes match for ' foo , bar '
     new c008719  Update to Sling Parent POM 22 with baselining enabled
     new 73217ee  SLING-3981 : Make dependency to config admin optional
     new 40209b6  [maven-release-plugin] prepare release org.apache.sling.settings-1.3.4
     new 1e1bf8b  [maven-release-plugin]  copy for tag org.apache.sling.settings-1.3.4

The 67 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-settings] 01/07: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.settings-1.3.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-settings.git

commit ca1d3d50a31aff4f78c0cb4255b29424fcae64fc
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 8 15:04:42 2014 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings@1608822 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index d8d5aa6..e44a6fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.settings</artifactId>
     <packaging>bundle</packaging>
-    <version>1.3.2</version>
+    <version>1.3.3-SNAPSHOT</version>
 
     <name>Apache Sling Settings</name>
     <description>
@@ -38,13 +38,13 @@
 
     <scm>
         <connection>
-            scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.settings-1.3.2
+            scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings
         </connection>
         <developerConnection>
-            scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.settings-1.3.2
+            scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings
         </developerConnection>
         <url>
-            http://svn.apache.org/viewvc/sling/tags/org.apache.sling.settings-1.3.2
+            http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/settings
         </url>
     </scm>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-settings] 03/07: SLING-3818 - RunModeImplTest.testParseRunModes fails under Java 8 : Parsed runModes match for ' foo , bar '

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.settings-1.3.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-settings.git

commit 521ed2b3606ea983fc634f5c39ef7c42f43d5fc9
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Aug 4 15:54:19 2014 +0000

    SLING-3818 - RunModeImplTest.testParseRunModes fails under Java 8 :
    Parsed runModes match for ' foo , bar '
    
    Updated the test to no longer rely on the order of the returned run
    modes.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings@1615633 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/settings/impl/RunModeImplTest.java     | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/sling/settings/impl/RunModeImplTest.java b/src/test/java/org/apache/sling/settings/impl/RunModeImplTest.java
index 658fad5..d32f5e6 100644
--- a/src/test/java/org/apache/sling/settings/impl/RunModeImplTest.java
+++ b/src/test/java/org/apache/sling/settings/impl/RunModeImplTest.java
@@ -18,8 +18,9 @@
  */
 package org.apache.sling.settings.impl;
 
-import static org.junit.Assert.assertArrayEquals;
+import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
@@ -27,6 +28,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Dictionary;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
@@ -74,8 +76,13 @@ public class RunModeImplTest {
     private void assertParse(String str, String [] expected) {
         final SlingSettingsService rm = new SlingSettingsServiceImpl(new BundleContextMock(str, null, null), new StartupHandlerImpl());
         final Set<String> modes = rm.getRunModes();
-        final String[] actual = modes.toArray(new String[modes.size()]);
-        assertArrayEquals("Parsed runModes match for '" + str + "'", expected, actual);
+
+        Set<String> expectedSet = new HashSet<String>(expected.length);
+        for (String expectedEntry : expected) {
+            expectedSet.add(expectedEntry);
+        }
+
+        assertThat("Parsed runModes match for '" + str + "'", modes, equalTo(expectedSet));
     }
 
     @org.junit.Test public void testParseRunModes() {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-settings] 02/07: Updated to parent version 20

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.settings-1.3.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-settings.git

commit e11f9196abe54de40ec067ccd1994ab1143d5b38
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Aug 1 19:16:26 2014 +0000

    Updated to parent version 20
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings@1615208 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index e44a6fc..64aa6f4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>19</version>
+        <version>20</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-settings] 04/07: Update to Sling Parent POM 22 with baselining enabled

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.settings-1.3.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-settings.git

commit c008719e65680e3f0d3b48cfcd2494350eb8d3f5
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 1 06:57:44 2014 +0000

    Update to Sling Parent POM 22 with baselining enabled
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings@1628622 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 64aa6f4..acc17d8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>20</version>
+        <version>22</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-settings] 06/07: [maven-release-plugin] prepare release org.apache.sling.settings-1.3.4

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.settings-1.3.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-settings.git

commit 40209b6672de1c99b8a3d8f6e991bacd16445751
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Oct 6 18:22:06 2014 +0000

    [maven-release-plugin] prepare release org.apache.sling.settings-1.3.4
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings@1629727 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5f09f76..f86edd8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <artifactId>org.apache.sling.settings</artifactId>
     <packaging>bundle</packaging>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.4</version>
 
     <name>Apache Sling Settings</name>
     <description>
@@ -38,13 +38,13 @@
 
     <scm>
         <connection>
-            scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings
+            scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.settings-1.3.4
         </connection>
         <developerConnection>
-            scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings
+            scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.settings-1.3.4
         </developerConnection>
         <url>
-            http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/settings
+            http://svn.apache.org/viewvc/sling/tags/org.apache.sling.settings-1.3.4
         </url>
     </scm>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-settings] 07/07: [maven-release-plugin] copy for tag org.apache.sling.settings-1.3.4

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.settings-1.3.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-settings.git

commit 1e1bf8beb366bc86b367b03c191d6af6347cb0a0
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Oct 6 18:22:14 2014 +0000

    [maven-release-plugin]  copy for tag org.apache.sling.settings-1.3.4
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.settings-1.3.4@1629728 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-settings] 05/07: SLING-3981 : Make dependency to config admin optional

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.settings-1.3.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-settings.git

commit 73217eec517df3a0109beaaba0f68cd1616062f9
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 1 08:48:44 2014 +0000

    SLING-3981 : Make dependency to config admin optional
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings@1628645 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   5 +-
 .../sling/settings/SlingSettingsService.java       |   6 +
 .../apache/sling/settings/impl/RunModeCommand.java |  30 ++--
 .../sling/settings/impl/ServicesListener.java      | 156 +++++++++++++++------
 .../settings/impl/SettingsServiceConfigurator.java |  24 +++-
 .../settings/impl/SlingSettingsServiceImpl.java    |   1 +
 6 files changed, 159 insertions(+), 63 deletions(-)

diff --git a/pom.xml b/pom.xml
index acc17d8..5f09f76 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,10 +71,11 @@
                             org.apache.sling.settings.impl.Activator
                         </Bundle-Activator>
                         <DynamicImport-Package>
-                            org.osgi.service.cm
+                            org.osgi.service.cm,
+                            org.apache.felix.shell
                         </DynamicImport-Package>
                         <Import-Package>
-                            !org.osgi.service.cm,
+                            org.osgi.service.cm;resolution:=optional,
                             org.apache.felix.shell;resolution:=optional, 
                             *
                         </Import-Package>
diff --git a/src/main/java/org/apache/sling/settings/SlingSettingsService.java b/src/main/java/org/apache/sling/settings/SlingSettingsService.java
index 563f7b5..15bf795 100644
--- a/src/main/java/org/apache/sling/settings/SlingSettingsService.java
+++ b/src/main/java/org/apache/sling/settings/SlingSettingsService.java
@@ -89,24 +89,28 @@ public interface SlingSettingsService {
      * Utility method to generate an absolute path
      * within Sling Home.
      *
+     * @return the absolute including the sling home directory.
      * @since 1.1.0
      */
     String getAbsolutePathWithinSlingHome(String relativePath);
 
     /**
      * The identifier of the running Sling instance.
+     * @return The unique Sling identifier.
      */
     String getSlingId();
 
     /**
      * Returns the value of the {@link #SLING_HOME}
      * property.
+     * @return The sling home.
      */
     String getSlingHomePath();
 
     /**
      * Returns the value of the {@link #SLING_HOME_URL}
      * property.
+     * @return Sling home as a URL.
      */
     URL getSlingHome();
 
@@ -120,12 +124,14 @@ public interface SlingSettingsService {
     /**
      * Return the optional name of the instance.
      * @return The name of the instance or <code>null</code>.
+     * @since 1.3
      */
     String getSlingName();
 
     /**
      * Return the optional description of the instance.
      * @return The description of the instance or <code>null</code>.
+     * @since 1.3
      */
     String getSlingDescription();
 }
diff --git a/src/main/java/org/apache/sling/settings/impl/RunModeCommand.java b/src/main/java/org/apache/sling/settings/impl/RunModeCommand.java
index 990b6a3..06b0dd3 100644
--- a/src/main/java/org/apache/sling/settings/impl/RunModeCommand.java
+++ b/src/main/java/org/apache/sling/settings/impl/RunModeCommand.java
@@ -33,35 +33,25 @@ import org.osgi.framework.ServiceRegistration;
  */
 public class RunModeCommand implements Command {
 
-    private static ServiceRegistration pluginReg;
+    private static final String CMD_NAME = "runmodes";
+
+    private final ServiceRegistration pluginReg;
+
+    private final Set<String> modes;
 
-    public static void initPlugin(final BundleContext bundleContext,
-            final Set<String> modes) {
-        final RunModeCommand command = new RunModeCommand(modes);
+    public RunModeCommand(final BundleContext btx, final Set<String> modes) {
+        this.modes = modes;
 
         final Dictionary<String, String> props = new Hashtable<String, String>();
         props.put(Constants.SERVICE_DESCRIPTION,
             "Apache Sling Sling Run Mode Shell Command");
         props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
 
-        pluginReg = bundleContext.registerService(Command.class.getName(),
-                command,
-                props);
+        pluginReg = btx.registerService(Command.class.getName(), this, props);
     }
 
-    public static void destroyPlugin() {
-        if ( pluginReg != null) {
-            pluginReg.unregister();
-            pluginReg = null;
-        }
-    }
-
-    private static final String CMD_NAME = "runmodes";
-
-    private Set<String> modes;
-
-    public RunModeCommand(final Set<String> modes) {
-        this.modes = modes;
+    public void destroy() {
+        pluginReg.unregister();
     }
 
     /**
diff --git a/src/main/java/org/apache/sling/settings/impl/ServicesListener.java b/src/main/java/org/apache/sling/settings/impl/ServicesListener.java
index 0494219..d0dd139 100644
--- a/src/main/java/org/apache/sling/settings/impl/ServicesListener.java
+++ b/src/main/java/org/apache/sling/settings/impl/ServicesListener.java
@@ -23,16 +23,13 @@ import java.util.Hashtable;
 
 import org.apache.sling.launchpad.api.StartupHandler;
 import org.apache.sling.settings.SlingSettingsService;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.cm.ManagedService;
 
 /**
  * The <code>ServicesListener</code> listens for the required services
@@ -47,12 +44,16 @@ public class ServicesListener {
     /** The listener for the startup handler. */
     private final Listener startupListener;
 
+    /** The listener for configuration admin. */
+    private ConfigAdminListener configAdminListener;
+
+    /** The listener for the shell. */
+    private ShellListener shellListener;
+
+
     /** The registration of the settings service. */
     private ServiceRegistration settingsReg;
 
-    /** The registration of the managed service. */
-    private ServiceRegistration managedServiceReg;
-
     /**
      * Start listeners
      */
@@ -87,47 +88,34 @@ public class ServicesListener {
                                                settingsService, props);
         SlingPropertiesPrinter.initPlugin(bundleContext);
         SlingSettingsPrinter.initPlugin(bundleContext, settingsService);
-        try {
-            RunModeCommand.initPlugin(bundleContext, settingsService.getRunModes());
-        } catch (final Throwable ignore) {
-            // we just ignore this
-        }
-        // setup manager service for configuration handling
-        final Dictionary<String, String> msProps = new Hashtable<String, String>();
-        msProps.put(Constants.SERVICE_PID, settingsService.getClass().getName());
-        msProps.put(Constants.SERVICE_DESCRIPTION,
-            "Apache Sling Managed Service for the Settings Service");
-        msProps.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
-        managedServiceReg = this.bundleContext.registerService(ManagedService.class.getName(), new ServiceFactory() {
-
-            public void ungetService(final Bundle bundle, final ServiceRegistration registration,
-                    final Object service) {
-                // nothing to do
-            }
 
-            public Object getService(final Bundle bundle, final ServiceRegistration registration) {
-                return new SettingsServiceConfigurator(settingsService);
-            }
-        }, msProps);
+        // add config admin support
+        this.configAdminListener = new ConfigAdminListener(settingsService);
+        this.configAdminListener.start();
+
+        // add shell support
+        this.shellListener = new ShellListener(settingsService);
+        this.shellListener.start();
     }
+
     /**
      * Deactivate this listener.
      */
     public void deactivate() {
-        if ( this.managedServiceReg != null ) {
-            this.managedServiceReg.unregister();
-            this.managedServiceReg = null;
+        if ( this.shellListener != null ) {
+            this.shellListener.deactivate();
+            this.shellListener = null;
+        }
+        if ( this.configAdminListener != null ) {
+            this.configAdminListener.deactivate();
+            this.configAdminListener = null;
         }
         this.startupListener.deactivate();
         if ( this.settingsReg != null ) {
             this.settingsReg.unregister();
             this.settingsReg = null;
         }
-        try {
-            RunModeCommand.destroyPlugin();
-        } catch (Throwable ignore) {
-            // we just ignore this
-        }
+
         SlingSettingsPrinter.destroyPlugin();
         SlingPropertiesPrinter.destroyPlugin();
     }
@@ -135,7 +123,7 @@ public class ServicesListener {
     /**
      * Helper class listening for service events for a defined service.
      */
-    protected final class Listener implements ServiceListener {
+    private abstract class AbstractListener implements ServiceListener {
 
         /** The name of the service. */
         private final String serviceName;
@@ -149,7 +137,7 @@ public class ServicesListener {
         /**
          * Constructor
          */
-        public Listener(final String serviceName) {
+        public AbstractListener(final String serviceName) {
             this.serviceName = serviceName;
         }
 
@@ -193,7 +181,7 @@ public class ServicesListener {
                     if ( this.service == null ) {
                         this.reference = null;
                     } else {
-                        notifyChange();
+                        serviceChanged();
                     }
                 }
             }
@@ -207,7 +195,7 @@ public class ServicesListener {
                 this.service = null;
                 bundleContext.ungetService(this.reference);
                 this.reference = null;
-                notifyChange();
+                serviceChanged();
             }
         }
 
@@ -221,5 +209,95 @@ public class ServicesListener {
                 this.releaseService();
             }
         }
+
+        protected abstract void serviceChanged();
+    }
+
+    /**
+     * Helper class listening for service events for a defined service.
+     */
+    private final class Listener extends AbstractListener {
+
+        /**
+         * Constructor
+         */
+        public Listener(final String serviceName) {
+            super(serviceName);
+        }
+
+        @Override
+        protected void serviceChanged() {
+            notifyChange();
+        }
+    }
+
+    /**
+     * Helper class listening for service events for config admin
+     */
+    private final class ConfigAdminListener extends AbstractListener {
+
+        private Object settingsServiceConfigurator;
+
+        private final SlingSettingsServiceImpl settings;
+
+        /**
+         * Constructor
+         */
+        public ConfigAdminListener(final SlingSettingsServiceImpl settings) {
+            super("org.osgi.service.cm.ConfigurationAdmin");
+            this.settings = settings;
+        }
+
+        @Override
+        protected void serviceChanged() {
+            if ( this.getService() != null && this.settingsServiceConfigurator == null ) {
+                this.settingsServiceConfigurator = new SettingsServiceConfigurator(bundleContext, settings);
+            }
+        }
+
+        @Override
+        public void deactivate() {
+            super.deactivate();
+            if ( settingsServiceConfigurator != null ) {
+                ((SettingsServiceConfigurator)settingsServiceConfigurator).destroy();
+                settingsServiceConfigurator = null;
+            }
+        }
+
+    }
+
+    /**
+     * Helper class listening for service events for config admin
+     */
+    private final class ShellListener extends AbstractListener {
+
+        private Object runModeCommand;
+
+        private final SlingSettingsServiceImpl settings;
+
+        /**
+         * Constructor
+         */
+        public ShellListener(final SlingSettingsServiceImpl settings) {
+            super("org.apache.felix.shell.ShellService");
+            this.settings = settings;
+        }
+
+        @Override
+        protected void serviceChanged() {
+            if ( this.getService() != null && this.runModeCommand == null ) {
+                this.runModeCommand = new RunModeCommand(bundleContext, settings.getRunModes());
+            }
+        }
+
+        @Override
+        public void deactivate() {
+            super.deactivate();
+            if ( runModeCommand != null ) {
+                ((RunModeCommand)runModeCommand).destroy();
+                runModeCommand = null;
+            }
+        }
+
     }
 }
diff --git a/src/main/java/org/apache/sling/settings/impl/SettingsServiceConfigurator.java b/src/main/java/org/apache/sling/settings/impl/SettingsServiceConfigurator.java
index 74228ae..85d0b54 100644
--- a/src/main/java/org/apache/sling/settings/impl/SettingsServiceConfigurator.java
+++ b/src/main/java/org/apache/sling/settings/impl/SettingsServiceConfigurator.java
@@ -19,7 +19,11 @@
 package org.apache.sling.settings.impl;
 
 import java.util.Dictionary;
+import java.util.Hashtable;
 
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.cm.ConfigurationException;
 import org.osgi.service.cm.ManagedService;
 
@@ -27,12 +31,28 @@ public class SettingsServiceConfigurator implements ManagedService {
 
     private final SlingSettingsServiceImpl settings;
 
-    public SettingsServiceConfigurator(final SlingSettingsServiceImpl s) {
+    private final ServiceRegistration managedServiceReg;
+
+    public SettingsServiceConfigurator(final BundleContext btx,
+            final SlingSettingsServiceImpl s) {
         this.settings = s;
+        // setup manager service for configuration handling
+        final Dictionary<String, String> msProps = new Hashtable<String, String>();
+        msProps.put(Constants.SERVICE_PID, s.getClass().getName());
+        msProps.put(Constants.SERVICE_DESCRIPTION,
+            "Apache Sling Managed Service for the Settings Service");
+        msProps.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
+        managedServiceReg = btx.registerService(ManagedService.class.getName(), this, msProps);
     }
 
     @SuppressWarnings({ "unchecked", "rawtypes" })
     public void updated(final Dictionary properties) throws ConfigurationException {
-        this.settings.update(properties);
+        if ( properties != null ) {
+            this.settings.update(properties);
+        }
+    }
+
+    public void destroy() {
+        managedServiceReg.unregister();
     }
 }
diff --git a/src/main/java/org/apache/sling/settings/impl/SlingSettingsServiceImpl.java b/src/main/java/org/apache/sling/settings/impl/SlingSettingsServiceImpl.java
index 1281495..56448c5 100644
--- a/src/main/java/org/apache/sling/settings/impl/SlingSettingsServiceImpl.java
+++ b/src/main/java/org/apache/sling/settings/impl/SlingSettingsServiceImpl.java
@@ -241,6 +241,7 @@ public class SlingSettingsServiceImpl
     }
 
 
+    @SuppressWarnings("unchecked")
     private List<Options> readOptions(final BundleContext context) {
         List<Options> optionsList = null;
         final File file = context.getDataFile(OPTIONS_FILE);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.