Author: bdelacretaz
Date: Thu Aug 8 13:11:07 2013
New Revision: 1511770
URL: http://svn.apache.org/r1511770
Log:
SLING-2987 - add metatype + reorganize packages
Added:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxAttributeHealthCheck.java
- copied, changed from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxAttributeHealthCheck.java
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxScriptBinding.java
- copied, changed from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxScriptBinding.java
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/OsgiScriptBinding.java
- copied, changed from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/OsgiScriptBinding.java
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/ScriptableHealthCheck.java
- copied, changed from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/ScriptableHealthCheck.java
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/resources/OSGI-INF/
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/resources/OSGI-INF/metatype/
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/resources/OSGI-INF/metatype/metatype.properties
sling/branches/SLING-2987-healthcheck-redesign/sling-demo/src/main/resources/SLING-CONTENT/apps/hc/demo/install/org.apache.sling.hc.JmxAttributeHealthCheck-1.json
- copied unchanged from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/sling-demo/src/main/resources/SLING-CONTENT/apps/hc/demo/install/org.apache.sling.hc.impl.JmxAttributeHealthCheck-1.json
sling/branches/SLING-2987-healthcheck-redesign/sling-demo/src/main/resources/SLING-CONTENT/apps/hc/demo/install/org.apache.sling.hc.ScriptableHealthCheck-1.json
- copied unchanged from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/sling-demo/src/main/resources/SLING-CONTENT/apps/hc/demo/install/org.apache.sling.hc.impl.ScriptableHealthCheck-1.json
sling/branches/SLING-2987-healthcheck-redesign/sling-demo/src/main/resources/SLING-CONTENT/apps/hc/demo/install/org.apache.sling.hc.ScriptableHealthCheck-2.json
- copied unchanged from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/sling-demo/src/main/resources/SLING-CONTENT/apps/hc/demo/install/org.apache.sling.hc.impl.ScriptableHealthCheck-2.json
Removed:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxAttributeHealthCheck.java
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxScriptBinding.java
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/OsgiScriptBinding.java
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/ScriptableHealthCheck.java
sling/branches/SLING-2987-healthcheck-redesign/sling-demo/src/main/resources/SLING-CONTENT/apps/hc/demo/install/org.apache.sling.hc.impl.JmxAttributeHealthCheck-1.json
sling/branches/SLING-2987-healthcheck-redesign/sling-demo/src/main/resources/SLING-CONTENT/apps/hc/demo/install/org.apache.sling.hc.impl.ScriptableHealthCheck-1.json
sling/branches/SLING-2987-healthcheck-redesign/sling-demo/src/main/resources/SLING-CONTENT/apps/hc/demo/install/org.apache.sling.hc.impl.ScriptableHealthCheck-2.json
Modified:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/JmxAttributeHealthCheckTest.java
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java
Copied:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxAttributeHealthCheck.java
(from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxAttributeHealthCheck.java)
URL:
http://svn.apache.org/viewvc/sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxAttributeHealthCheck.java?p2=sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxAttributeHealthCheck.java&p1=sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxAttributeHealthCheck.java&r1=1511738&r2=1511770&rev=1511770&view=diff
==============================================================================
---
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxAttributeHealthCheck.java
(original)
+++
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxAttributeHealthCheck.java
Thu Aug 8 13:11:07 2013
@@ -15,7 +15,7 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
-package org.apache.sling.hc.impl;
+package org.apache.sling.hc.impl.healthchecks;
import java.lang.management.ManagementFactory;
import java.util.Arrays;
@@ -41,7 +41,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** {@link HealthCheck} that checks a single JMX attribute */
-@Component(configurationFactory=true, policy=ConfigurationPolicy.REQUIRE,
metatype=true)
+@Component(
+ name="org.apache.sling.hc.JmxAttributeHealthCheck",
+ configurationFactory=true,
+ policy=ConfigurationPolicy.REQUIRE,
+ metatype=true)
@Service
public class JmxAttributeHealthCheck implements HealthCheck {
Copied:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxScriptBinding.java
(from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxScriptBinding.java)
URL:
http://svn.apache.org/viewvc/sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxScriptBinding.java?p2=sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxScriptBinding.java&p1=sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxScriptBinding.java&r1=1511738&r2=1511770&rev=1511770&view=diff
==============================================================================
---
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/JmxScriptBinding.java
(original)
+++
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/JmxScriptBinding.java
Thu Aug 8 13:11:07 2013
@@ -15,7 +15,7 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
-package org.apache.sling.hc.impl;
+package org.apache.sling.hc.impl.healthchecks;
import java.lang.management.ManagementFactory;
Copied:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/OsgiScriptBinding.java
(from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/OsgiScriptBinding.java)
URL:
http://svn.apache.org/viewvc/sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/OsgiScriptBinding.java?p2=sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/OsgiScriptBinding.java&p1=sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/OsgiScriptBinding.java&r1=1511738&r2=1511770&rev=1511770&view=diff
==============================================================================
---
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/OsgiScriptBinding.java
(original)
+++
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/OsgiScriptBinding.java
Thu Aug 8 13:11:07 2013
@@ -15,7 +15,7 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
-package org.apache.sling.hc.impl;
+package org.apache.sling.hc.impl.healthchecks;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
Copied:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/ScriptableHealthCheck.java
(from r1511738,
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/ScriptableHealthCheck.java)
URL:
http://svn.apache.org/viewvc/sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/ScriptableHealthCheck.java?p2=sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/ScriptableHealthCheck.java&p1=sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/ScriptableHealthCheck.java&r1=1511738&r2=1511770&rev=1511770&view=diff
==============================================================================
---
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/ScriptableHealthCheck.java
(original)
+++
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/healthchecks/ScriptableHealthCheck.java
Thu Aug 8 13:11:07 2013
@@ -15,7 +15,7 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
-package org.apache.sling.hc.impl;
+package org.apache.sling.hc.impl.healthchecks;
import java.util.Arrays;
import java.util.HashMap;
@@ -42,7 +42,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** {@link HealthCheck} that checks a scriptable expression */
-@Component(configurationFactory=true, policy=ConfigurationPolicy.REQUIRE,
metatype=true)
+@Component(
+ name="org.apache.sling.hc.ScriptableHealthCheck",
+ configurationFactory=true,
+ policy=ConfigurationPolicy.REQUIRE,
+ metatype=true)
@Service
public class ScriptableHealthCheck implements HealthCheck {
Added:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/resources/OSGI-INF/metatype/metatype.properties
URL:
http://svn.apache.org/viewvc/sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1511770&view=auto
==============================================================================
---
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/resources/OSGI-INF/metatype/metatype.properties
(added)
+++
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/resources/OSGI-INF/metatype/metatype.properties
Thu Aug 8 13:11:07 2013
@@ -0,0 +1,56 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# This file contains localization strings for configuration labels and
+# descriptions as used in the metatype.xml descriptor generated by the
+# the Sling SCR plugin
+
+org.apache.sling.hc.JmxAttributeHealthCheck.name = JMX Attribute Health Check
+org.apache.sling.hc.JmxAttributeHealthCheck.description = Checks the value of
a single JMX attribute.
+
+org.apache.sling.hc.ScriptableHealthCheck.name = Scriptable Health Check
+org.apache.sling.hc.ScriptableHealthCheck.description = Uses scripted
expressions to verify multiple JMX \
+ attributes or other values.
+
+mbean.name.name = MBean name
+mbean.name.description = The name of the MBean to check.
+
+attribute.name.name = Attribute name
+attribute.name.description = The name of the MBean attribute to check.
+
+attribute.value.constraint.name = Attribute value constraint
+attribute.value.constraint.description = Constraint on the MBean attribute
value.
+
+hc.tags.name = Health Check tags
+hc.tags.description = List of tags for this Health Check service, used to
select \
+ subsets of Health Check services for execution.
+
+hc.name.name = Health Check Name
+hc.name.description = Name of this Health Check service, used for example to
identify the \
+ corresponding JMX MBean.
+
+expression.name = Expression
+expression.description = The value of this expression must be "true" for the
Health Check \
+ to be successful.
+
+language.extension.name = Language extension
+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.
\ No newline at end of file
Modified:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/JmxAttributeHealthCheckTest.java
URL:
http://svn.apache.org/viewvc/sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/JmxAttributeHealthCheckTest.java?rev=1511770&r1=1511769&r2=1511770&view=diff
==============================================================================
---
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/JmxAttributeHealthCheckTest.java
(original)
+++
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/JmxAttributeHealthCheckTest.java
Thu Aug 8 13:11:07 2013
@@ -24,6 +24,7 @@ import java.util.Hashtable;
import org.apache.sling.hc.api.Result;
import org.apache.sling.hc.api.ResultLog;
+import org.apache.sling.hc.impl.healthchecks.JmxAttributeHealthCheck;
import org.junit.Test;
import org.mockito.Mockito;
import org.osgi.service.component.ComponentContext;
Modified:
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java
URL:
http://svn.apache.org/viewvc/sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java?rev=1511770&r1=1511769&r2=1511770&view=diff
==============================================================================
---
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java
(original)
+++
sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java
Thu Aug 8 13:11:07 2013
@@ -28,6 +28,7 @@ import javax.script.ScriptEngineManager;
import org.apache.sling.hc.api.Result;
import org.apache.sling.hc.api.ResultLog;
+import org.apache.sling.hc.impl.healthchecks.ScriptableHealthCheck;
import org.junit.Test;
import org.mockito.Matchers;
import org.mockito.Mockito;