Author: cziegeler Date: Tue Feb 17 16:08:42 2015 New Revision: 1660431 URL: http://svn.apache.org/r1660431 Log: Correct metatype information
Modified: sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java Modified: sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java?rev=1660431&r1=1660430&r2=1660431&view=diff ============================================================================== --- sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java (original) +++ sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java Tue Feb 17 16:08:42 2015 @@ -51,10 +51,10 @@ import org.slf4j.LoggerFactory; /** * Runs health checks that are configured with a cron expression for asynchronous * execution. Used by HealthCheckExecutor. - * + * */ @Service({ AsyncHealthCheckExecutor.class }) -@Component(label = "Sling Async Health Check Executor", +@Component(label = "Apache Sling Async Health Check Executor", description = "Runs async health checks", metatype = true, immediate = true) public class AsyncHealthCheckExecutor implements ServiceListener { @@ -69,8 +69,8 @@ public class AsyncHealthCheckExecutor im private Map<HealthCheckMetadata, HealthCheckAsyncJob> registeredJobs = new HashMap<HealthCheckMetadata, HealthCheckAsyncJob>(); private BundleContext bundleContext; - - + + @Activate protected final void activate(final ComponentContext componentContext) { @@ -129,11 +129,11 @@ public class AsyncHealthCheckExecutor im } private boolean scheduleHealthCheck(HealthCheckMetadata descriptor) { - + if(!isAsync(descriptor)) { return false; } - + try { HealthCheckAsyncJob healthCheckAsyncJob = new HealthCheckAsyncJob(descriptor); LOG.debug("Scheduling job {} with cron expression {}", healthCheckAsyncJob, descriptor.getAsyncCronExpression()); @@ -150,10 +150,10 @@ public class AsyncHealthCheckExecutor im private boolean unscheduleHealthCheck(HealthCheckMetadata descriptor) { - // here no check for isAsync must be used to ensure previously + // here no check for isAsync must be used to ensure previously // scheduled async checks are correctly unscheduled if they have // changed from async to sync. - + HealthCheckAsyncJob job = registeredJobs.remove(descriptor); try { if (job != null) { @@ -199,7 +199,7 @@ public class AsyncHealthCheckExecutor im LOG.debug("Updated result for async hc {} with {}", result.getHealthCheckMetadata(), result); } } - + private boolean isAsync(HealthCheckMetadata healthCheckMetadata) { return StringUtils.isNotBlank(healthCheckMetadata.getAsyncCronExpression()); }