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

olli pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hc-core.git


The following commit(s) were added to refs/heads/master by this push:
     new c61ffcf  SLING-7469 Migrate to OSGi R6 annotations and use bnd Maven 
plugins
c61ffcf is described below

commit c61ffcfddcc1f15ba552f198f2a6decaf894f47b
Author: Oliver Lietz <o...@apache.org>
AuthorDate: Fri Feb 2 23:46:42 2018 +0100

    SLING-7469 Migrate to OSGi R6 annotations and use bnd Maven plugins
    
    * update to Sling Parent 33
    * clean up and update dependencies
---
 bnd.bnd                                            | 17 +++++
 pom.xml                                            | 43 ++++-------
 .../sling/hc/core/impl/CompositeHealthCheck.java   | 59 +++++----------
 .../impl/CompositeHealthCheckConfiguration.java    | 61 +++++++++++++++
 .../core/impl/JmxAdjustableStatusForTesting.java   |  6 +-
 .../hc/core/impl/JmxAttributeHealthCheck.java      | 62 +++++----------
 .../impl/JmxAttributeHealthCheckConfiguration.java | 67 ++++++++++++++++
 .../hc/core/impl/JmxScriptBindingsProvider.java    | 13 ++--
 .../sling/hc/core/impl/ScriptableHealthCheck.java  | 74 ++++++------------
 .../impl/ScriptableHealthCheckConfiguration.java   | 61 +++++++++++++++
 .../impl/executor/AsyncHealthCheckExecutor.java    | 15 ++--
 .../impl/executor/HealthCheckExecutorImpl.java     | 88 +++++++++-------------
 .../HealthCheckExecutorImplConfiguration.java      | 53 +++++++++++++
 .../impl/servlet/HealthCheckExecutorServlet.java   | 49 ++++++------
 .../HealthCheckExecutorServletConfiguration.java   | 49 ++++++++++++
 .../hc/core/impl/servlet/ResultHtmlSerializer.java | 30 ++------
 .../servlet/ResultHtmlSerializerConfiguration.java | 46 +++++++++++
 .../hc/core/impl/servlet/ResultJsonSerializer.java |  8 +-
 .../hc/core/impl/servlet/ResultTxtSerializer.java  |  8 +-
 .../impl/servlet/ResultTxtVerboseSerializer.java   | 36 +++------
 .../ResultTxtVerboseSerializerConfiguration.java   | 53 +++++++++++++
 .../sling/hc/jmx/impl/HealthCheckMBeanCreator.java |  8 +-
 .../hc/core/impl/JmxAttributeHealthCheckTest.java  | 20 ++---
 .../hc/core/impl/ScriptableHealthCheckTest.java    | 30 ++++----
 src/test/java/org/apache/sling/hc/core/it/U.java   |  4 +-
 25 files changed, 612 insertions(+), 348 deletions(-)

diff --git a/bnd.bnd b/bnd.bnd
new file mode 100644
index 0000000..c20ac21
--- /dev/null
+++ b/bnd.bnd
@@ -0,0 +1,17 @@
+Bundle-Category: sling
+
+Bundle-Description: ${project.description}
+
+Bundle-DocURL: https://sling.apache.org
+
+Bundle-License: Apache License, Version 2.0
+
+Bundle-Vendor: The Apache Software Foundation
+
+-baseline: *
+
+-removeheaders:\
+  Embed-Dependency,\
+  Embed-Transitive,\
+  Include-Resource,\
+  Private-Package
diff --git a/pom.xml b/pom.xml
index 2994b14..b618f33 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,13 +24,11 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>26</version>
+        <version>33</version>
         <relativePath />
     </parent>
 
-    <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.hc.core</artifactId>
-    <packaging>bundle</packaging>
     <version>1.2.11-SNAPSHOT</version>
 
     <name>Apache Sling Health Check Core</name>
@@ -41,14 +39,11 @@
     </description>
 
     <properties>
-        <pax-exam.version>4.6.0</pax-exam.version>
+        <pax-exam.version>4.11.0</pax-exam.version>
         <pax-link.version>2.4.3</pax-link.version>
         
<org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
         <felix.shell>false</felix.shell>
         
<project.bundle.file>${project.build.directory}/${project.build.finalName}.jar</project.bundle.file>
-
-        <!-- temporarily until next release -->
-        <baseline.skip>true</baseline.skip>
     </properties>
     
     <scm>
@@ -61,14 +56,13 @@
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
+                <groupId>biz.aQute.bnd</groupId>
+                <artifactId>bnd-maven-plugin</artifactId>
             </plugin>
+          <plugin>
+            <groupId>biz.aQute.bnd</groupId>
+            <artifactId>bnd-baseline-maven-plugin</artifactId>
+          </plugin>
             <plugin>
               <groupId>org.jacoco</groupId>
               <artifactId>jacoco-maven-plugin</artifactId>
@@ -87,14 +81,6 @@
           <plugin>
             <groupId>org.apache.servicemix.tooling</groupId>
             <artifactId>depends-maven-plugin</artifactId>
-            <version>1.2</version>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>generate-depends-file</goal>
-                </goals>
-              </execution>
-            </executions>
           </plugin>
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
@@ -122,11 +108,13 @@
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
+            <artifactId>osgi.core</artifactId>
+          <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
+            <artifactId>osgi.cmpn</artifactId>
+          <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
@@ -137,11 +125,12 @@
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <version>1.6.2</version>
+          <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
+          <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
@@ -158,7 +147,6 @@
          <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-simple</artifactId>
-            <version>1.6.2</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -200,7 +188,7 @@
        <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.framework</artifactId>
-            <version>5.4.0</version>
+            <version>5.6.10</version>
             <scope>test</scope>
         </dependency>
           <dependency>
@@ -251,7 +239,6 @@
       <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>javax.servlet-api</artifactId>
-        <version>3.0.1</version>
         <scope>provided</scope>
       </dependency>
 
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java 
b/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java
index fae58f9..95ce1f4 100644
--- a/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java
+++ b/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java
@@ -18,20 +18,10 @@
 package org.apache.sling.hc.core.impl;
 
 import java.util.Arrays;
-import java.util.Dictionary;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.PropertyUnbounded;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.hc.api.HealthCheck;
 import org.apache.sling.hc.api.Result;
@@ -48,6 +38,12 @@ import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.component.ComponentConstants;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.metatype.annotations.Designate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,43 +52,23 @@ import org.slf4j.LoggerFactory;
  */
 
 @Component(
-        configurationFactory=true,
-        policy=ConfigurationPolicy.REQUIRE,
-        metatype=true,
-        label="Apache Sling Composite Health Check",
-        description="Executes a set of health checks, selected by tags.")
-@Properties({
-    @Property(name=HealthCheck.NAME,
-              label="Name",
-              description="Name of this health check."),
-    @Property(name=HealthCheck.TAGS, unbounded=PropertyUnbounded.ARRAY,
-              label="Tags",
-              description="List of tags for this health check, used to select 
" +
-                          "subsets of health checks for execution e.g. by a 
composite health check."),
-    @Property(name=HealthCheck.MBEAN_NAME,
-              label="MBean Name",
-              description="Name of the MBean to create for this health check. 
If empty, no MBean is registered.")
-})
-@Service(value=HealthCheck.class)
+    service = HealthCheck.class,
+    configurationPolicy = ConfigurationPolicy.REQUIRE
+)
+@Designate(
+    ocd = CompositeHealthCheckConfiguration.class,
+    factory = true
+)
 public class CompositeHealthCheck implements HealthCheck {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private static final boolean DEFAULT_COMBINE_TAGS_WITH_OR = false;
-
-    @Property(unbounded=PropertyUnbounded.ARRAY,
-              label="Filter Tags",
-              description="Tags used to select which health checks the 
composite health check executes.")
     static final String PROP_FILTER_TAGS = "filter.tags";
+
     private String [] filterTags;
 
-    @Property(boolValue = DEFAULT_COMBINE_TAGS_WITH_OR,
-            label="Combine Tags With Or",
-            description="Tags used to select which health checks the composite 
health check executes.")
-    static final String PROP_COMBINE_TAGS_WITH_OR = "filter.combineTagsWithOr";
     private boolean combineTagsWithOr;
 
-
     @Reference
     private HealthCheckExecutor healthCheckExecutor;
 
@@ -102,14 +78,13 @@ public class CompositeHealthCheck implements HealthCheck {
     private volatile ComponentContext componentContext;
 
     @Activate
-    protected void activate(final ComponentContext ctx) {
+    protected void activate(final CompositeHealthCheckConfiguration 
configuration, final ComponentContext ctx) {
         bundleContext = ctx.getBundleContext();
         componentContext = ctx;
         healthCheckFilter = new HealthCheckFilter(bundleContext);
 
-        final Dictionary properties = ctx.getProperties();
-        filterTags = 
PropertiesUtil.toStringArray(properties.get(PROP_FILTER_TAGS), new String[] {});
-        combineTagsWithOr = 
PropertiesUtil.toBoolean(properties.get(PROP_COMBINE_TAGS_WITH_OR), 
DEFAULT_COMBINE_TAGS_WITH_OR);
+        filterTags = configuration.filter_tags();
+        combineTagsWithOr = configuration.filter_combineTagsWithOr();
         log.debug("Activated, will select HealthCheck having tags {} {}", 
Arrays.asList(filterTags), combineTagsWithOr ? "using OR" : "using AND");
     }
 
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheckConfiguration.java
 
b/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheckConfiguration.java
new file mode 100644
index 0000000..6a8a02a
--- /dev/null
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheckConfiguration.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The SF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.sling.hc.core.impl;
+
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
+@ObjectClassDefinition(
+    name = "Apache Sling Composite Health Check",
+    description = "Executes a set of health checks, selected by tags."
+)
+@interface CompositeHealthCheckConfiguration {
+
+    @AttributeDefinition(
+        name = "Name",
+        description = "Name of this health check."
+    )
+    String hc_name() default "";
+
+    @AttributeDefinition(
+        name = "Tags",
+        description = "List of tags for this health check, used to select 
subsets of health checks for execution e.g. by a composite health check."
+    )
+    String[] hc_tags() default {};
+
+    @AttributeDefinition(
+        name = "MBean Name",
+        description = "Name of the MBean to create for this health check. If 
empty, no MBean is registered."
+    )
+    String hc_mbean_name() default "";
+
+    //
+
+    @AttributeDefinition(
+        name = "Filter Tags",
+        description = "Tags used to select which health checks the composite 
health check executes."
+    )
+    String[] filter_tags() default {};
+
+    @AttributeDefinition(
+        name = "Combine Tags With Or",
+        description = "Tags used to select which health checks the composite 
health check executes."
+    )
+    boolean filter_combineTagsWithOr() default false;
+
+}
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/JmxAdjustableStatusForTesting.java
 
b/src/main/java/org/apache/sling/hc/core/impl/JmxAdjustableStatusForTesting.java
index a569f25..b9b3f9a 100644
--- 
a/src/main/java/org/apache/sling/hc/core/impl/JmxAdjustableStatusForTesting.java
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/JmxAdjustableStatusForTesting.java
@@ -36,9 +36,6 @@ import javax.management.MBeanParameterInfo;
 import javax.management.ReflectionException;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.sling.hc.api.HealthCheck;
 import org.apache.sling.hc.api.Result;
 import org.apache.sling.hc.api.Result.Status;
@@ -47,6 +44,9 @@ import org.apache.sling.hc.util.FormattingResultLog;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheck.java 
b/src/main/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheck.java
index 37ca6e6..29805f9 100644
--- a/src/main/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheck.java
+++ b/src/main/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheck.java
@@ -18,74 +18,46 @@
 package org.apache.sling.hc.core.impl;
 
 import java.lang.management.ManagementFactory;
-import java.util.Map;
 
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.PropertyUnbounded;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.hc.api.HealthCheck;
 import org.apache.sling.hc.api.Result;
 import org.apache.sling.hc.util.FormattingResultLog;
 import org.apache.sling.hc.util.SimpleConstraintChecker;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.metatype.annotations.Designate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /** {@link HealthCheck} that checks a single JMX attribute */
 @Component(
-        configurationFactory=true,
-        policy=ConfigurationPolicy.REQUIRE,
-        metatype=true,
-        label="Apache Sling JMX Attribute Health Check",
-        description="Checks the value of a single JMX attribute.")
-@Properties({
-    @Property(name=HealthCheck.NAME,
-            label="Name",
-            description="Name of this health check."),
-    @Property(name=HealthCheck.TAGS, unbounded=PropertyUnbounded.ARRAY,
-              label="Tags",
-              description="List of tags for this health check, used to select 
" +
-                        "subsets of health checks for execution e.g. by a 
composite health check."),
-    @Property(name=HealthCheck.MBEAN_NAME,
-              label="MBean Name",
-              description="Name of the MBean to create for this health check. 
If empty, no MBean is registered.")
-})
-@Service(value=HealthCheck.class)
+    service = HealthCheck.class,
+    configurationPolicy = ConfigurationPolicy.REQUIRE
+)
+@Designate(
+    ocd = JmxAttributeHealthCheckConfiguration.class,
+    factory = true
+)
 public class JmxAttributeHealthCheck implements HealthCheck {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
+
     private String mbeanName;
     private String attributeName;
     private String constraint;
 
-    @Property(label="Check MBean Name",
-              description="The name of the MBean to check by this health 
check.")
-    public static final String PROP_OBJECT_NAME = "mbean.name";
-
-    @Property(label="Check Attribute Name",
-            description="The name of the MBean attribute to check by this 
health check.")
-    public static final String PROP_ATTRIBUTE_NAME = "attribute.name";
-
-    @Property(label="Check Attribute Constraint",
-            description="Constraint on the MBean attribute value.")
-    public static final String PROP_CONSTRAINT = "attribute.value.constraint";
-
-
     @Activate
-    protected void activate(final Map<String, Object> properties) {
-        mbeanName = PropertiesUtil.toString(properties.get(PROP_OBJECT_NAME), 
"");
-        attributeName = 
PropertiesUtil.toString(properties.get(PROP_ATTRIBUTE_NAME), "");
-        constraint = PropertiesUtil.toString(properties.get(PROP_CONSTRAINT), 
"");
+    protected void activate(final JmxAttributeHealthCheckConfiguration 
configuration) {
+        mbeanName = configuration.mbean_name();
+        attributeName = configuration.attribute_name();
+        constraint = configuration.attribute_value_constraint();
 
         log.debug("Activated with HealthCheck name={}, objectName={}, 
attribute={}, constraint={}",
-                new Object[] { properties.get(HealthCheck.NAME), mbeanName, 
attributeName, constraint });
+                new Object[] { configuration.hc_name(), mbeanName, 
attributeName, constraint });
     }
 
     @Override
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheckConfiguration.java
 
b/src/main/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheckConfiguration.java
new file mode 100644
index 0000000..0b5ff55
--- /dev/null
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheckConfiguration.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The SF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.sling.hc.core.impl;
+
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
+@ObjectClassDefinition(
+    name = "Apache Sling JMX Attribute Health Check",
+    description = "Checks the value of a single JMX attribute."
+)
+@interface JmxAttributeHealthCheckConfiguration {
+
+    @AttributeDefinition(
+        name = "Name",
+        description = "Name of this health check."
+    )
+    String hc_name() default "";
+
+    @AttributeDefinition(
+        name = "Tags",
+        description = "List of tags for this health check, used to select 
subsets of health checks for execution e.g. by a composite health check."
+    )
+    String[] hc_tags() default {};
+
+    @AttributeDefinition(
+        name = "MBean Name",
+        description = "Name of the MBean to create for this health check. If 
empty, no MBean is registered."
+    )
+    String hc_mbean_name() default "";
+
+    //
+
+    @AttributeDefinition(
+        name = "Check MBean Name",
+        description = "The name of the MBean to check by this health check."
+    )
+    String mbean_name() default "";
+
+    @AttributeDefinition(
+        name = "Check Attribute Name",
+        description = "The name of the MBean attribute to check by this health 
check."
+    )
+    String attribute_name() default "";
+
+    @AttributeDefinition(
+        name = "Check Attribute Constraint",
+        description = "Constraint on the MBean attribute value."
+    )
+    String attribute_value_constraint() default "";
+
+}
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/JmxScriptBindingsProvider.java 
b/src/main/java/org/apache/sling/hc/core/impl/JmxScriptBindingsProvider.java
index d48613a..bfdbd94 100644
--- a/src/main/java/org/apache/sling/hc/core/impl/JmxScriptBindingsProvider.java
+++ b/src/main/java/org/apache/sling/hc/core/impl/JmxScriptBindingsProvider.java
@@ -28,11 +28,9 @@ import javax.management.ObjectName;
 import javax.management.ReflectionException;
 import javax.script.Bindings;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.hc.util.FormattingResultLog;
 import org.apache.sling.scripting.api.BindingsValuesProvider;
+import org.osgi.service.component.annotations.Component;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -40,9 +38,12 @@ import org.slf4j.LoggerFactory;
  *  in scripted rules, to allow for writing scripted expressions
  *  like jmx.attribute("java.lang:type=ClassLoading", "LoadedClassCount") &gt; 
100
  */
-@Component
-@Service
-@Property(name="context", value="healthcheck")
+@Component(
+    service = BindingsValuesProvider.class,
+    property = {
+        "context=healthcheck"
+    }
+)
 public class JmxScriptBindingsProvider implements BindingsValuesProvider {
     private MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer();
     private final Logger log = LoggerFactory.getLogger(getClass());
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/ScriptableHealthCheck.java 
b/src/main/java/org/apache/sling/hc/core/impl/ScriptableHealthCheck.java
index 402494b..287910e 100644
--- a/src/main/java/org/apache/sling/hc/core/impl/ScriptableHealthCheck.java
+++ b/src/main/java/org/apache/sling/hc/core/impl/ScriptableHealthCheck.java
@@ -23,81 +23,53 @@ import javax.script.Bindings;
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
 
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.PropertyUnbounded;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.hc.api.HealthCheck;
 import org.apache.sling.hc.api.Result;
 import org.apache.sling.hc.util.FormattingResultLog;
 import org.apache.sling.scripting.api.BindingsValuesProvider;
-import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+import org.osgi.service.metatype.annotations.Designate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /** {@link HealthCheck} that checks a scriptable expression */
 @Component(
-        configurationFactory=true,
-        policy=ConfigurationPolicy.REQUIRE,
-        metatype=true,
-        label="Apache Sling Scriptable Health Check",
-        description="Uses scripted expressions to verify multiple JMX 
attributes or other values.")
-@Properties({
-    @Property(name=HealthCheck.NAME,
-            label="Name",
-            description="Name of this health check."),
-    @Property(name=HealthCheck.TAGS, unbounded=PropertyUnbounded.ARRAY,
-              label="Tags",
-              description="List of tags for this health check, used to select 
" +
-                        "subsets of health checks for execution e.g. by a 
composite health check."),
-    @Property(name=HealthCheck.MBEAN_NAME,
-              label="MBean Name",
-              description="Name of the MBean to create for this health check. 
If empty, no MBean is registered.")
-})
-@Service(value=HealthCheck.class)
+    service = HealthCheck.class,
+    configurationPolicy = ConfigurationPolicy.REQUIRE
+)
+@Designate(
+    ocd = ScriptableHealthCheckConfiguration.class,
+    factory = true
+)
 public class ScriptableHealthCheck implements HealthCheck {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
     private String expression;
     private String languageExtension;
 
-    private static final String DEFAULT_LANGUAGE_EXTENSION = "ecma";
-
-    @Property(label="Expression",
-              description="The value of this expression must be \"true\" for 
this check to be successful.")
-    public static final String PROP_EXPRESSION = "expression";
-
-    @Property(value=DEFAULT_LANGUAGE_EXTENSION,
-              label="Language Extension",
-              description="File extension of the language to use to evaluate 
the " +
-                      "expression, for example \"ecma\" or \"groovy\", 
asssuming the corresponding script engine " +
-                      "is available. By default \"ecma\" is used.")
-    public static final String PROP_LANGUAGE_EXTENSION = "language.extension";
-
     @Reference
     private ScriptEngineManager scriptEngineManager;
 
     @Reference(
-            cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE,
-            policy=ReferencePolicy.DYNAMIC,
-            referenceInterface=BindingsValuesProvider.class,
-            target="(context=healthcheck)")
+        cardinality = ReferenceCardinality.MULTIPLE,
+        policy = ReferencePolicy.DYNAMIC,
+        service = BindingsValuesProvider.class,
+        target = "(context=healthcheck)"
+    )
     private final Set<BindingsValuesProvider> bindingsValuesProviders = new 
HashSet<BindingsValuesProvider>();
 
     @Activate
-    protected void activate(ComponentContext ctx) {
-        expression = 
PropertiesUtil.toString(ctx.getProperties().get(PROP_EXPRESSION), "");
-        languageExtension = 
PropertiesUtil.toString(ctx.getProperties().get(PROP_LANGUAGE_EXTENSION), 
DEFAULT_LANGUAGE_EXTENSION);
+    protected void activate(final ScriptableHealthCheckConfiguration 
configuration) {
+        expression = configuration.expression();
+        languageExtension = configuration.language_extension();
 
         log.debug("Activated scriptable health check name={}, 
languageExtension={}, expression={}",
-                new Object[] {ctx.getProperties().get(HealthCheck.NAME),
+                new Object[] {configuration.hc_name(),
                 languageExtension, expression});
     }
 
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/ScriptableHealthCheckConfiguration.java
 
b/src/main/java/org/apache/sling/hc/core/impl/ScriptableHealthCheckConfiguration.java
new file mode 100644
index 0000000..9e1ba15
--- /dev/null
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/ScriptableHealthCheckConfiguration.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The SF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.sling.hc.core.impl;
+
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
+@ObjectClassDefinition(
+    name = "Apache Sling Scriptable Health Check",
+    description = "Uses scripted expressions to verify multiple JMX attributes 
or other values."
+)
+@interface ScriptableHealthCheckConfiguration {
+
+    @AttributeDefinition(
+        name = "Name",
+        description = "Name of this health check."
+    )
+    String hc_name() default "";
+
+    @AttributeDefinition(
+        name = "Tags",
+        description = "List of tags for this health check, used to select 
subsets of health checks for execution e.g. by a composite health check."
+    )
+    String[] hc_tags() default {};
+
+    @AttributeDefinition(
+        name = "MBean Name",
+        description = "Name of the MBean to create for this health check. If 
empty, no MBean is registered."
+    )
+    String hc_mbean_name() default "";
+
+    //
+
+    @AttributeDefinition(
+        name = "Expression",
+        description = "The value of this expression must be \"true\" for this 
check to be successful."
+    )
+    String expression() default "";
+
+    @AttributeDefinition(
+        name = "Language Extension",
+        description = "File extension of the language to use to evaluate the 
expression, for example \"ecma\" or \"groovy\", assuming the corresponding 
script engine is available. By default \"ecma\" is used."
+    )
+    String language_extension() default "ecma";
+
+}
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java
 
b/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java
index a6a558c..a8daaba 100644
--- 
a/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java
@@ -28,11 +28,6 @@ import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.scheduler.Scheduler;
 import org.apache.sling.hc.api.HealthCheck;
 import org.apache.sling.hc.api.Result;
@@ -46,6 +41,10 @@ import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -54,8 +53,10 @@ import org.slf4j.LoggerFactory;
  * execution. Used by HealthCheckExecutor.
  *
  */
-@Service({ AsyncHealthCheckExecutor.class })
-@Component(immediate = true)
+@Component(
+    service = AsyncHealthCheckExecutor.class,
+    immediate = true
+)
 public class AsyncHealthCheckExecutor implements ServiceListener {
 
     private static final Logger LOG = 
LoggerFactory.getLogger(AsyncHealthCheckExecutor.class);
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java
 
b/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java
index 80bc62a..b494d2a 100644
--- 
a/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java
@@ -17,8 +17,6 @@
  */
 package org.apache.sling.hc.core.impl.executor;
 
-import static org.apache.sling.hc.util.FormattingResultLog.msHumanReadable;
-
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -36,14 +34,6 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.lang3.time.StopWatch;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Modified;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.commons.threads.ModifiableThreadPoolConfig;
 import org.apache.sling.commons.threads.ThreadPool;
 import org.apache.sling.commons.threads.ThreadPoolManager;
@@ -63,42 +53,35 @@ import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Modified;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.metatype.annotations.Designate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static 
org.apache.sling.hc.core.impl.executor.HealthCheckExecutorImplConfiguration.LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_DEFAULT_MS;
+import static 
org.apache.sling.hc.core.impl.executor.HealthCheckExecutorImplConfiguration.RESULT_CACHE_TTL_DEFAULT_MS;
+import static 
org.apache.sling.hc.core.impl.executor.HealthCheckExecutorImplConfiguration.TIMEOUT_DEFAULT_MS;
+import static org.apache.sling.hc.util.FormattingResultLog.msHumanReadable;
+
 /**
  * Runs health checks for a given list of tags in parallel.
  *
  */
-@Service(value = {HealthCheckExecutor.class, 
ExtendedHealthCheckExecutor.class})
-@Component(label = "Apache Sling Health Check Executor",
-        description = "Runs health checks for a given list of tags in 
parallel.",
-        metatype = true, immediate = true) // immediate = true to keep the 
cache!
+@Component(
+    service = {HealthCheckExecutor.class, ExtendedHealthCheckExecutor.class},
+    immediate = true // immediate = true to keep the cache!
+)
+@Designate(
+    ocd = HealthCheckExecutorImplConfiguration.class
+)
 public class HealthCheckExecutorImpl implements ExtendedHealthCheckExecutor, 
ServiceListener {
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
-    private static final long TIMEOUT_DEFAULT_MS = 2000;
-
-    public static final String PROP_TIMEOUT_MS = "timeoutInMs";
-    @Property(name = PROP_TIMEOUT_MS, label = "Timeout",
-            description = "Timeout in ms until a check is marked as timed out",
-            longValue = TIMEOUT_DEFAULT_MS)
-
-    private static final long LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_DEFAULT_MS 
= 1000 * 60 * 5;
-
-    public static final String PROP_LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_MS = 
"longRunningFutureThresholdForCriticalMs";
-    @Property(name = PROP_LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_MS, label = 
"Timeout threshold for CRITICAL",
-            description = "Threshold in ms until a check is marked as 
'exceedingly' timed out and will marked CRITICAL instead of WARN only",
-            longValue = LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_DEFAULT_MS)
-
-    private static final long RESULT_CACHE_TTL_DEFAULT_MS = 1000 * 2;
-    public static final String PROP_RESULT_CACHE_TTL_MS = "resultCacheTtlInMs";
-    @Property(name = PROP_RESULT_CACHE_TTL_MS, label = "Results Cache TTL in 
Ms",
-            description = "Result Cache time to live - results will be cached 
for the given time",
-            longValue = RESULT_CACHE_TTL_DEFAULT_MS)
-
-
     private long timeoutInMs;
 
     private long longRunningFutureThresholdForRedMs;
@@ -114,19 +97,20 @@ public class HealthCheckExecutorImpl implements 
ExtendedHealthCheckExecutor, Ser
 
     @Reference
     private ThreadPoolManager threadPoolManager;
+
     private ThreadPool hcThreadPool;
 
     private BundleContext bundleContext;
 
     @Activate
-    protected final void activate(final Map<String, Object> properties, final 
BundleContext bundleContext) {
+    protected final void activate(final HealthCheckExecutorImplConfiguration 
configuration, final BundleContext bundleContext) {
         this.bundleContext = bundleContext;
 
         final ModifiableThreadPoolConfig hcThreadPoolConfig = new 
ModifiableThreadPoolConfig();
         hcThreadPoolConfig.setMaxPoolSize(25);
         hcThreadPool = threadPoolManager.create(hcThreadPoolConfig, "Health 
Check Thread Pool");
 
-        this.modified(properties);
+        configure(configuration);
 
         try {
             this.bundleContext.addServiceListener(this, "("
@@ -138,33 +122,35 @@ public class HealthCheckExecutorImpl implements 
ExtendedHealthCheckExecutor, Ser
     }
 
     @Modified
-    protected final void modified(final Map<String, Object> properties) {
-        this.timeoutInMs = 
PropertiesUtil.toLong(properties.get(PROP_TIMEOUT_MS), TIMEOUT_DEFAULT_MS);
+    protected final void modified(final HealthCheckExecutorImplConfiguration 
configuration) {
+        configure(configuration);
+    }
+
+    @Deactivate
+    protected final void deactivate() {
+        threadPoolManager.release(hcThreadPool);
+        this.bundleContext.removeServiceListener(this);
+        this.bundleContext = null;
+        this.healthCheckResultCache.clear();
+    }
 
-        if ( this.timeoutInMs <= 0L) {
+    protected final void configure(final HealthCheckExecutorImplConfiguration 
configuration) {
+        this.timeoutInMs = configuration.timeoutInMs();
+        if (this.timeoutInMs <= 0L) {
             this.timeoutInMs = TIMEOUT_DEFAULT_MS;
         }
 
-        this.longRunningFutureThresholdForRedMs = 
PropertiesUtil.toLong(properties.get(PROP_LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_MS),
-                LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_DEFAULT_MS);
+        this.longRunningFutureThresholdForRedMs = 
configuration.longRunningFutureThresholdForCriticalMs();
         if (this.longRunningFutureThresholdForRedMs <= 0L) {
             this.longRunningFutureThresholdForRedMs = 
LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_DEFAULT_MS;
         }
 
-        this.resultCacheTtlInMs = 
PropertiesUtil.toLong(properties.get(PROP_RESULT_CACHE_TTL_MS), 
RESULT_CACHE_TTL_DEFAULT_MS);
+        this.resultCacheTtlInMs = configuration.resultCacheTtlInMs();
         if (this.resultCacheTtlInMs <= 0L) {
             this.resultCacheTtlInMs = RESULT_CACHE_TTL_DEFAULT_MS;
         }
     }
 
-    @Deactivate
-    protected final void deactivate() {
-        threadPoolManager.release(hcThreadPool);
-        this.bundleContext.removeServiceListener(this);
-        this.bundleContext = null;
-        this.healthCheckResultCache.clear();
-    }
-
     @Override
     public void serviceChanged(final ServiceEvent event) {
         if ( event.getType() == ServiceEvent.UNREGISTERING ) {
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplConfiguration.java
 
b/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplConfiguration.java
new file mode 100644
index 0000000..dbf79d2
--- /dev/null
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplConfiguration.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The SF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.sling.hc.core.impl.executor;
+
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
+@ObjectClassDefinition(
+    name = "Apache Sling Health Check Executor",
+    description = "Runs health checks for a given list of tags in parallel."
+)
+@interface HealthCheckExecutorImplConfiguration {
+
+    long TIMEOUT_DEFAULT_MS = 2000L;
+
+    long LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_DEFAULT_MS = 1000L * 60 * 5;
+
+    long RESULT_CACHE_TTL_DEFAULT_MS = 1000L * 2;
+
+    @AttributeDefinition(
+        name = "Timeout",
+        description = "Timeout in ms until a check is marked as timed out"
+    )
+    long timeoutInMs() default TIMEOUT_DEFAULT_MS;
+
+    @AttributeDefinition(
+        name = "Timeout threshold for CRITICAL",
+        description = "Threshold in ms until a check is marked as 
'exceedingly' timed out and will marked CRITICAL instead of WARN only"
+    )
+    long longRunningFutureThresholdForCriticalMs() default 
LONGRUNNING_FUTURE_THRESHOLD_CRITICAL_DEFAULT_MS;
+
+    @AttributeDefinition(
+        name = "Results Cache TTL in Ms",
+        description = "Result Cache time to live - results will be cached for 
the given time"
+    )
+    long resultCacheTtlInMs() default RESULT_CACHE_TTL_DEFAULT_MS;
+
+}
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
index e610186..fa29500 100644
--- 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
@@ -34,12 +34,6 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.hc.api.Result;
 import org.apache.sling.hc.api.Result.Status;
@@ -48,7 +42,13 @@ import 
org.apache.sling.hc.api.execution.HealthCheckExecutionResult;
 import org.apache.sling.hc.api.execution.HealthCheckExecutor;
 import org.apache.sling.hc.api.execution.HealthCheckSelector;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
 import org.osgi.service.http.HttpService;
+import org.osgi.service.metatype.annotations.Designate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -69,9 +69,12 @@ import org.slf4j.LoggerFactory;
  * Useful in combination with load balancers.
  * <p>
  * NOTE: This servlet registers directly (low-level) at the HttpService and is 
not processed by sling (better performance, fewer dependencies, no 
authentication required, 503 can be sent without the progress tracker 
information). */
-@Component(label = "Apache Sling Health Check Executor Servlet",
-        description = "Serializes health check results into html or json 
format",
-        policy = ConfigurationPolicy.REQUIRE, metatype = true)
+@Component(
+    configurationPolicy = ConfigurationPolicy.REQUIRE
+)
+@Designate(
+    ocd = HealthCheckExecutorServletConfiguration.class
+)
 public class HealthCheckExecutorServlet extends HttpServlet {
     private static final long serialVersionUID = 8013511523994541848L;
 
@@ -125,26 +128,17 @@ public class HealthCheckExecutorServlet extends 
HttpServlet {
     private static final String CACHE_CONTROL_KEY = "Cache-control";
     private static final String CACHE_CONTROL_VALUE = "no-cache";
 
-    private static final String SERVLET_PATH_DEFAULT = "/system/health";
-
-    public static final String PROPERTY_SERVLET_PATH = "servletPath";
-    @Property(name = PROPERTY_SERVLET_PATH, label = "Path",
-            description = "Servlet path (defaults to " + SERVLET_PATH_DEFAULT 
+ " in order to not be accessible via Apache/Internet)", value = 
SERVLET_PATH_DEFAULT)
-    private String servletPath;
-
     private String[] servletPaths;
 
-    public static final String PROPERTY_DISABLED = "disabled";
-    @Property(name = PROPERTY_DISABLED, label = "Disabled",
-            description = "Allows to disable the servlet if required for 
security reasons", boolValue = false)
     private boolean disabled;
 
-    private static final String CORS_ORIGIN_HEADER_NAME = 
"Access-Control-Allow-Origin";
-    public static final String CORS_ORIGIN_HEADER_DEFAULT_VALUE = "*";
-    public static final String PROPERTY_CORS_ORIGIN_HEADER_VALUE = 
"cors.accessControlAllowOrigin";
-    @Property(name = PROPERTY_CORS_ORIGIN_HEADER_VALUE, label = "CORS 
Access-Control-Allow-Origin", description = "Sets the 
Access-Control-Allow-Origin CORS header. If blank no header is sent.", value = 
CORS_ORIGIN_HEADER_DEFAULT_VALUE)
+    private String servletPath;
+
     private String corsAccessControlAllowOrigin;
 
+    private static final String CORS_ORIGIN_HEADER_NAME = 
"Access-Control-Allow-Origin";
+
+
     @Reference
     private HttpService httpService;
 
@@ -164,11 +158,10 @@ public class HealthCheckExecutorServlet extends 
HttpServlet {
     ResultTxtVerboseSerializer verboseTxtSerializer;
 
     @Activate
-    protected final void activate(final ComponentContext context) {
-        final Dictionary<?, ?> properties = context.getProperties();
-        this.servletPath = 
PropertiesUtil.toString(properties.get(PROPERTY_SERVLET_PATH), 
SERVLET_PATH_DEFAULT);
-        this.disabled = 
PropertiesUtil.toBoolean(properties.get(PROPERTY_DISABLED), false);
-        this.corsAccessControlAllowOrigin = 
PropertiesUtil.toString(properties.get(PROPERTY_CORS_ORIGIN_HEADER_VALUE), 
CORS_ORIGIN_HEADER_DEFAULT_VALUE);
+    protected final void activate(final 
HealthCheckExecutorServletConfiguration configuration) {
+        this.servletPath = configuration.servletPath();
+        this.disabled = configuration.disabled();
+        this.corsAccessControlAllowOrigin = 
configuration.cors_accessControlAllowOrigin();
 
         Map<String, HttpServlet> servletsToRegister = new 
LinkedHashMap<String, HttpServlet>();
         servletsToRegister.put(this.servletPath, this);
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServletConfiguration.java
 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServletConfiguration.java
new file mode 100644
index 0000000..2bbf456
--- /dev/null
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServletConfiguration.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The SF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.sling.hc.core.impl.servlet;
+
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
+@ObjectClassDefinition(
+    name = "Apache Sling Health Check Executor Servlet",
+    description = "Serializes health check results into html or json format"
+)
+@interface HealthCheckExecutorServletConfiguration {
+
+    String SERVLET_PATH_DEFAULT = "/system/health";
+
+    @AttributeDefinition(
+        name = "Disabled",
+        description = "Allows to disable the servlet if required for security 
reasons"
+    )
+    boolean disabled() default false;
+
+    @AttributeDefinition(
+        name = "Path",
+        description = "Servlet path (defaults to " + SERVLET_PATH_DEFAULT + " 
in order to not be accessible via Apache/Internet)"
+    )
+    String servletPath() default SERVLET_PATH_DEFAULT;
+
+    @AttributeDefinition(
+        name = "CORS Access-Control-Allow-Origin",
+        description = "Sets the Access-Control-Allow-Origin CORS header. If 
blank no header is sent."
+    )
+    String cors_accessControlAllowOrigin() default "*";
+
+}
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
index 6f02e67..e8cf059 100644
--- 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
@@ -28,40 +28,26 @@ import java.util.List;
 
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.hc.api.Result;
 import org.apache.sling.hc.api.ResultLog.Entry;
 import org.apache.sling.hc.api.execution.HealthCheckExecutionResult;
 import org.apache.sling.hc.util.FormattingResultLog;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
 
 /** Serializes health check results into html format. */
-@Service(ResultHtmlSerializer.class)
-@Component(metatype = true, name = "Apache Sling Health Check Result HTML 
Serializer", description = "Serializer for health check results in HTML format")
+@Component(
+    service = ResultHtmlSerializer.class
+)
 public class ResultHtmlSerializer {
-    private static final String CSS_STYLE_DEFAULT = "body { font-size:12px; 
font-family:arial,verdana,sans-serif;background-color:#FFFDF1; }\n"
-            + "h1 { font-size:20px;}\n"
-            + "table { font-size:12px; border:#ccc 1px solid; 
border-radius:3px; }\n"
-            + "table th { padding:5px; text-align: left; background: #ededed; 
}\n"
-            + "table td { padding:5px; border-top: 1px solid #ffffff; 
border-bottom:1px solid #e0e0e0; border-left: 1px solid #e0e0e0; }\n"
-            + ".statusOK { background-color:#CCFFCC;}\n"
-            + ".statusWARN { background-color:#FFE569;}\n"
-            + ".statusCRITICAL { background-color:#F0975A;}\n"
-            + ".statusHEALTH_CHECK_ERROR { background-color:#F16D4E;}\n"
-            + ".helpText { color:grey; font-size:80%; }\n";
-    public static final String PROPERTY_CSS_STYLE = "styleString";
-    @Property(name = PROPERTY_CSS_STYLE, label = "CSS Style",
-            description = "CSS Style - can be configured to change the look 
and feel of the html result page.", value = CSS_STYLE_DEFAULT)
+
     private String styleString;
 
     @Activate
-    protected final void activate(final ComponentContext context) {
-        final Dictionary<?, ?> properties = context.getProperties();
-        this.styleString = 
PropertiesUtil.toString(properties.get(PROPERTY_CSS_STYLE), CSS_STYLE_DEFAULT);
+    protected final void activate(final ResultHtmlSerializerConfiguration 
configuration) {
+        this.styleString = configuration.styleString();
     }
 
     public String serialize(final Result overallResult, final 
List<HealthCheckExecutionResult> executionResults, String escapedHelpText, 
boolean includeDebug) {
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializerConfiguration.java
 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializerConfiguration.java
new file mode 100644
index 0000000..017dfc3
--- /dev/null
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializerConfiguration.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The SF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.sling.hc.core.impl.servlet;
+
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
+@ObjectClassDefinition(
+    name = "Apache Sling Health Check Result HTML Serializer",
+    description = "Serializer for health check results in HTML format"
+)
+@interface ResultHtmlSerializerConfiguration {
+
+    String CSS_STYLE_DEFAULT = "body { font-size:12px; 
font-family:arial,verdana,sans-serif;background-color:#FFFDF1; }\n"
+        + "h1 { font-size:20px;}\n"
+        + "table { font-size:12px; border:#ccc 1px solid; border-radius:3px; 
}\n"
+        + "table th { padding:5px; text-align: left; background: #ededed; }\n"
+        + "table td { padding:5px; border-top: 1px solid #ffffff; 
border-bottom:1px solid #e0e0e0; border-left: 1px solid #e0e0e0; }\n"
+        + ".statusOK { background-color:#CCFFCC;}\n"
+        + ".statusWARN { background-color:#FFE569;}\n"
+        + ".statusCRITICAL { background-color:#F0975A;}\n"
+        + ".statusHEALTH_CHECK_ERROR { background-color:#F16D4E;}\n"
+        + ".helpText { color:grey; font-size:80%; }\n";
+
+    @AttributeDefinition(
+        name = "CSS Style",
+        description = "CSS Style - can be configured to change the look and 
feel of the html result page."
+    )
+    String styleString() default CSS_STYLE_DEFAULT;
+
+}
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultJsonSerializer.java 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultJsonSerializer.java
index 388a4de..7848d48 100644
--- 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultJsonSerializer.java
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultJsonSerializer.java
@@ -28,17 +28,17 @@ import javax.json.JsonObject;
 import javax.json.JsonObjectBuilder;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.hc.api.Result;
 import org.apache.sling.hc.api.ResultLog;
 import org.apache.sling.hc.api.execution.HealthCheckExecutionResult;
+import org.osgi.service.component.annotations.Component;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /** Serializes health check results into json format. */
-@Service(ResultJsonSerializer.class)
-@Component(metatype = false)
+@Component(
+    service = ResultJsonSerializer.class
+)
 public class ResultJsonSerializer {
 
     private static final Logger LOG = 
LoggerFactory.getLogger(ResultJsonSerializer.class);
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtSerializer.java 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtSerializer.java
index 4dbaed6..e8f9c57 100644
--- 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtSerializer.java
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtSerializer.java
@@ -17,14 +17,14 @@
  */
 package org.apache.sling.hc.core.impl.servlet;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.hc.api.Result;
+import org.osgi.service.component.annotations.Component;
 
 /** Serializes health check results into a simple text message (ideal to be 
used by a load balancer that would discard
  * further information). */
-@Component
-@Service(ResultTxtSerializer.class)
+@Component(
+    service = ResultTxtSerializer.class
+)
 public class ResultTxtSerializer {
     public String serialize(final Result overallResult) {
         return overallResult.getStatus().toString();
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtVerboseSerializer.java
 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtVerboseSerializer.java
index a1bee36..9fcac59 100644
--- 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtVerboseSerializer.java
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtVerboseSerializer.java
@@ -20,61 +20,45 @@ package org.apache.sling.hc.core.impl.servlet;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.text.WordUtils;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.hc.api.Result;
 import org.apache.sling.hc.api.ResultLog;
 import org.apache.sling.hc.api.execution.HealthCheckExecutionResult;
 import org.apache.sling.hc.util.FormattingResultLog;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /** Serializes health check results into a verbose text message. */
-@Component(label = "Apache Sling Health Check Verbose Text Serializer", 
description = "Serializes health check results to a verbose text format", 
metatype = true)
-@Service(ResultTxtVerboseSerializer.class)
+@Component(
+    service = ResultTxtVerboseSerializer.class
+)
 public class ResultTxtVerboseSerializer {
 
     private static final Logger LOG = 
LoggerFactory.getLogger(ResultTxtVerboseSerializer.class);
 
     private static final String NEWLINE = "\n"; // not using system prop 
'line.separator' as not the local but the calling system is relevant.
 
-    public static final int PROP_TOTAL_WIDTH_DEFAULT = 140;
-    public static final String PROP_TOTAL_WIDTH = "totalWidth";
-    @Property(name = PROP_TOTAL_WIDTH, label = "Total Width", description = 
"Total width of all columns in verbose txt rendering (in characters)", intValue 
= PROP_TOTAL_WIDTH_DEFAULT)
     private int totalWidth;
 
-    public static final int PROP_COL_WIDTH_NAME_DEFAULT = 30;
-    public static final String PROP_COL_WIDTH_NAME = "colWidthName";
-    @Property(name = PROP_COL_WIDTH_NAME, label = "Name Column Width", 
description = "Column width of health check name (in characters)", intValue = 
PROP_COL_WIDTH_NAME_DEFAULT)
     private int colWidthName;
 
-    public static final int PROP_COL_WIDTH_RESULT_DEFAULT = 9;
-    public static final String PROP_COL_WIDTH_RESULT = "colWidthResult";
-    @Property(name = PROP_COL_WIDTH_RESULT, label = "Result Column Width", 
description = "Column width of health check result (in characters)", intValue = 
PROP_COL_WIDTH_RESULT_DEFAULT)
     private int colWidthResult;
 
-    public static final int PROP_COL_WIDTH_TIMING_DEFAULT = 22;
-    public static final String PROP_COL_WIDTH_TIMING = "colWidthTiming";
-    @Property(name = PROP_COL_WIDTH_TIMING, label = "Timing Column Width", 
description = "Column width of health check timing (in characters)", intValue = 
PROP_COL_WIDTH_TIMING_DEFAULT)
     private int colWidthTiming;
 
     private int colWidthWithoutLog;
     private int colWidthLog;
 
     @Activate
-    protected final void activate(Map<?, ?> properties) {
-        this.totalWidth = 
PropertiesUtil.toInteger(properties.get(PROP_TOTAL_WIDTH), 
PROP_TOTAL_WIDTH_DEFAULT);
-        this.colWidthName = 
PropertiesUtil.toInteger(properties.get(PROP_COL_WIDTH_NAME), 
PROP_COL_WIDTH_NAME_DEFAULT);
-        this.colWidthResult = 
PropertiesUtil.toInteger(properties.get(PROP_COL_WIDTH_RESULT), 
PROP_COL_WIDTH_RESULT_DEFAULT);
-        this.colWidthTiming = 
PropertiesUtil.toInteger(properties.get(PROP_COL_WIDTH_TIMING), 
PROP_COL_WIDTH_TIMING_DEFAULT);
-
+    protected final void activate(final 
ResultTxtVerboseSerializerConfiguration configuration) {
+        this.totalWidth = configuration.totalWidth();
+        this.colWidthName = configuration.colWidthName();
+        this.colWidthResult = configuration.colWidthResult();
+        this.colWidthTiming = configuration.colWidthTiming();
         colWidthWithoutLog = colWidthName + colWidthResult + colWidthTiming;
         colWidthLog = totalWidth - colWidthWithoutLog;
     }
diff --git 
a/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtVerboseSerializerConfiguration.java
 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtVerboseSerializerConfiguration.java
new file mode 100644
index 0000000..78b8ace
--- /dev/null
+++ 
b/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultTxtVerboseSerializerConfiguration.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The SF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.sling.hc.core.impl.servlet;
+
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+
+@ObjectClassDefinition(
+    name = "Apache Sling Health Check Verbose Text Serializer",
+    description = "Serializes health check results to a verbose text format"
+)
+@interface ResultTxtVerboseSerializerConfiguration {
+
+    @AttributeDefinition(
+        name = "Total Width",
+        description = "Total width of all columns in verbose txt rendering (in 
characters)"
+    )
+    int totalWidth() default 140;
+
+    @AttributeDefinition(
+        name = "Name Column Width",
+        description = "Column width of health check name (in characters)"
+    )
+    int colWidthName() default 30;
+
+    @AttributeDefinition(
+        name = "Result Column Width",
+        description = "Column width of health check result (in characters)"
+    )
+    int colWidthResult() default 9;
+
+    @AttributeDefinition(
+        name = "Timing Column Width",
+        description = "Column width of health check timing (in characters)"
+    )
+    int colWidthTiming() default 22;
+
+}
diff --git 
a/src/main/java/org/apache/sling/hc/jmx/impl/HealthCheckMBeanCreator.java 
b/src/main/java/org/apache/sling/hc/jmx/impl/HealthCheckMBeanCreator.java
index bd32ec0..4f4ddcf 100644
--- a/src/main/java/org/apache/sling/hc/jmx/impl/HealthCheckMBeanCreator.java
+++ b/src/main/java/org/apache/sling/hc/jmx/impl/HealthCheckMBeanCreator.java
@@ -27,15 +27,15 @@ import java.util.Map;
 
 import javax.management.DynamicMBean;
 
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Reference;
 import org.apache.sling.hc.api.HealthCheck;
 import org.apache.sling.hc.core.impl.executor.ExtendedHealthCheckExecutor;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
 import org.osgi.util.tracker.ServiceTracker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git 
a/src/test/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheckTest.java 
b/src/test/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheckTest.java
index 0d4770c..eb4f335 100644
--- 
a/src/test/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheckTest.java
+++ 
b/src/test/java/org/apache/sling/hc/core/impl/JmxAttributeHealthCheckTest.java
@@ -17,24 +17,24 @@
  */
 package org.apache.sling.hc.core.impl;
 
-import static org.junit.Assert.assertEquals;
-
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.sling.hc.api.Result;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 public class JmxAttributeHealthCheckTest {
 
     static void assertJmxValue(String objectName, String attributeName, String 
constraint, boolean expected) {
         final JmxAttributeHealthCheck hc = new JmxAttributeHealthCheck();
 
-        final Map<String, Object> props = new HashMap<String, Object>();
-        props.put(JmxAttributeHealthCheck.PROP_OBJECT_NAME, objectName);
-        props.put(JmxAttributeHealthCheck.PROP_ATTRIBUTE_NAME, attributeName);
-        props.put(JmxAttributeHealthCheck.PROP_CONSTRAINT, constraint);
-        hc.activate(props);
+        final JmxAttributeHealthCheckConfiguration configuration = 
mock(JmxAttributeHealthCheckConfiguration.class);
+        when(configuration.mbean_name()).thenReturn(objectName);
+        when(configuration.attribute_name()).thenReturn(attributeName);
+        
when(configuration.attribute_value_constraint()).thenReturn(constraint);
+
+        hc.activate(configuration);
 
         final Result r = hc.execute();
         assertEquals("Expected result " + expected, expected, r.isOk());
diff --git 
a/src/test/java/org/apache/sling/hc/core/impl/ScriptableHealthCheckTest.java 
b/src/test/java/org/apache/sling/hc/core/impl/ScriptableHealthCheckTest.java
index 7f13534..421cedc 100644
--- a/src/test/java/org/apache/sling/hc/core/impl/ScriptableHealthCheckTest.java
+++ b/src/test/java/org/apache/sling/hc/core/impl/ScriptableHealthCheckTest.java
@@ -17,12 +17,8 @@
  */
 package org.apache.sling.hc.core.impl;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 import java.lang.reflect.Field;
 import java.util.Dictionary;
-import java.util.Hashtable;
 
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
@@ -31,9 +27,13 @@ import org.apache.sling.hc.api.Result;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Matchers;
-import org.mockito.Mockito;
 import org.osgi.service.component.ComponentContext;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
 public class ScriptableHealthCheckTest {
     
     private ScriptableHealthCheck hc;
@@ -44,18 +44,20 @@ public class ScriptableHealthCheckTest {
     private void assertExpression(String expression, String languageExtension, 
boolean expected) throws Exception {
         final ScriptEngine rhino = new 
ScriptEngineManager().getEngineByExtension("js");
         assertNotNull("With the rhino jar in our classpath, we should get a js 
script engine", rhino);
-        final ScriptEngineManager manager = 
Mockito.mock(ScriptEngineManager.class);
-        
Mockito.when(manager.getEngineByExtension(Matchers.same("ecma"))).thenReturn(rhino);
+        final ScriptEngineManager manager = mock(ScriptEngineManager.class);
+        
when(manager.getEngineByExtension(Matchers.same("ecma"))).thenReturn(rhino);
         final Field f = hc.getClass().getDeclaredField("scriptEngineManager");
         f.setAccessible(true);
         f.set(hc, manager);
-        
-        props.put(ScriptableHealthCheck.PROP_EXPRESSION, expression);
-        if(languageExtension != null) {
-            props.put(ScriptableHealthCheck.PROP_LANGUAGE_EXTENSION, 
languageExtension);
+
+        final ScriptableHealthCheckConfiguration configuration = 
mock(ScriptableHealthCheckConfiguration.class);
+        when(configuration.expression()).thenReturn(expression);
+        if (languageExtension != null) {
+            
when(configuration.language_extension()).thenReturn(languageExtension);
+        } else {
+            when(configuration.language_extension()).thenReturn("ecma");
         }
-        Mockito.when(ctx.getProperties()).thenReturn(props);
-        hc.activate(ctx);
+        hc.activate(configuration);
         final Result r = hc.execute();
         assertEquals("Expecting result " + expected, expected, r.isOk());
     }
@@ -63,8 +65,6 @@ public class ScriptableHealthCheckTest {
     @Before
     public void setup() {
         hc = new ScriptableHealthCheck();
-        ctx = Mockito.mock(ComponentContext.class);
-        props = new Hashtable<String, String>();
         hc.bindBindingsValuesProvider(jmxScriptBindingsProvider);
     }
     
diff --git a/src/test/java/org/apache/sling/hc/core/it/U.java 
b/src/test/java/org/apache/sling/hc/core/it/U.java
index 2064c8e..b03e315 100644
--- a/src/test/java/org/apache/sling/hc/core/it/U.java
+++ b/src/test/java/org/apache/sling/hc/core/it/U.java
@@ -101,8 +101,8 @@ public class U {
             provision(
                     bundle(bundleFile.toURI().toString()),
                     
mavenBundle().groupId("javax.servlet").artifactId("javax.servlet-api").versionAsInProject(),
-                    mavenBundle("org.apache.felix", "org.apache.felix.scr", 
"1.6.2"),
-                    mavenBundle("org.apache.felix", 
"org.apache.felix.configadmin", "1.8.8"),
+                    mavenBundle("org.apache.felix", "org.apache.felix.scr", 
"2.0.14"),
+                    mavenBundle("org.apache.felix", 
"org.apache.felix.configadmin", "1.8.16"),
                     mavenBundle("org.apache.sling", 
"org.apache.sling.commons.osgi", "2.2.0"),
                     mavenBundle("org.apache.sling", 
"org.apache.sling.commons.johnzon").versionAsInProject(),
                     mavenBundle("org.apache.sling", 
"org.apache.sling.jcr.jcr-wrapper", "2.0.0"),

-- 
To stop receiving notification emails like this one, please contact
o...@apache.org.

Reply via email to