sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1686367 - /sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DefaultStartupHandler.java
Date Fri, 19 Jun 2015 06:41:43 GMT
Author: cziegeler
Date: Fri Jun 19 06:41:42 2015
New Revision: 1686367

URL: http://svn.apache.org/r1686367
Log:
SLING-4823 : Register a service when the system is ready

Modified:
    sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DefaultStartupHandler.java

Modified: sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DefaultStartupHandler.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DefaultStartupHandler.java?rev=1686367&r1=1686366&r2=1686367&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DefaultStartupHandler.java
(original)
+++ sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/DefaultStartupHandler.java
Fri Jun 19 06:41:42 2015
@@ -20,7 +20,9 @@ package org.apache.sling.launchpad.base.
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.util.Dictionary;
 import java.util.HashSet;
+import java.util.Hashtable;
 import java.util.Set;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -36,6 +38,7 @@ import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleEvent;
 import org.osgi.framework.BundleListener;
+import org.osgi.framework.Constants;
 import org.osgi.framework.FrameworkEvent;
 import org.osgi.framework.FrameworkListener;
 import org.osgi.framework.ServiceReference;
@@ -382,6 +385,10 @@ public class DefaultStartupHandler
         this.bundleContext.removeFrameworkListener(this);
 
         // register startup service
+        final Dictionary<String, Object> serviceProps = new Hashtable<String, Object>();
+        serviceProps.put(StartupMode.class.getName(), this.startupMode.name());
+        serviceProps.put(Constants.SERVICE_DESCRIPTION, "Apache Sling Startup Service");
+        serviceProps.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         this.startupServiceReg = this.bundleContext.registerService(StartupService.class,
new StartupService() {
 
             @Override
@@ -389,7 +396,7 @@ public class DefaultStartupHandler
                 return startupMode;
             }
 
-            }, null);
+            }, serviceProps);
     }
 
     /**



Mime
View raw message