@Properties(value={@Property(name="hc.name",label="Name",description="Name of this health check."),@Property(name="hc.tags",unbounded=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="hc.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) public class ScriptableHealthCheck extends Object implements HealthCheck
HealthCheck
that checks a scriptable expressionModifier and Type | Field and Description |
---|---|
static String |
PROP_EXPRESSION |
static String |
PROP_LANGUAGE_EXTENSION |
ASYNC_CRON_EXPRESSION, MBEAN_NAME, NAME, TAGS
Constructor and Description |
---|
ScriptableHealthCheck() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext ctx) |
void |
bindBindingsValuesProvider(org.apache.sling.scripting.api.BindingsValuesProvider bvp) |
Result |
execute()
Execute this health check and return a
Result
This is meant to execute quickly, access to external
systems, for example, should be managed asynchronously. |
void |
unbindBindingsValuesProvider(org.apache.sling.scripting.api.BindingsValuesProvider bvp) |
@Property(label="Expression", description="The value of this expression must be \"true\" for this check to be successful.") public static final String PROP_EXPRESSION
@Property(value="ecma", 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
@Activate protected void activate(org.osgi.service.component.ComponentContext ctx)
public Result execute()
HealthCheck
Result
This is meant to execute quickly, access to external
systems, for example, should be managed asynchronously.execute
in interface HealthCheck
public void bindBindingsValuesProvider(org.apache.sling.scripting.api.BindingsValuesProvider bvp)
public void unbindBindingsValuesProvider(org.apache.sling.scripting.api.BindingsValuesProvider bvp)
Copyright © 2013–2014 The Apache Software Foundation. All rights reserved.