diff options
Diffstat (limited to 'feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckFeature.java')
-rw-r--r-- | feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckFeature.java | 91 |
1 files changed, 46 insertions, 45 deletions
diff --git a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckFeature.java b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckFeature.java index 34c1fe3a..3a79a55c 100644 --- a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckFeature.java +++ b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckFeature.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * feature-healthcheck * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,53 +26,54 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * This feature provides healthcheck verification of remotely associated RESTful components + * This feature provides healthcheck verification of remotely associated RESTful components. */ -public class HealthCheckFeature implements PolicyEngineFeatureAPI { - - /** - * Logger - */ - private static Logger logger = LoggerFactory.getLogger(HealthCheckFeature.class); - - /** - * Properties Configuration Name - */ - public static final String CONFIGURATION_PROPERTIES_NAME = "feature-healthcheck"; +public class HealthCheckFeature implements PolicyEngineFeatureAPI { - @Override - public int getSequenceNumber() { - return 1000; - } + /** + * Logger. + */ + private static Logger logger = LoggerFactory.getLogger(HealthCheckFeature.class); - @Override - public boolean afterStart(PolicyEngine engine) { - try { - HealthCheck.monitor.start(); - } catch (IllegalStateException e) { - logger.error("Healthcheck Monitor cannot be started", e); - } - - return false; - } + /** + * Properties Configuration Name. + */ + public static final String CONFIGURATION_PROPERTIES_NAME = "feature-healthcheck"; - @Override - public boolean afterShutdown(PolicyEngine engine) { - try { - HealthCheck.monitor.stop(); - } catch (IllegalStateException e) { - logger.error("Healthcheck Monitor cannot be stopped", e); - } - - return false; - } - - /** - * gets the monitor - * @return the healthcheck monitor - */ - public HealthCheck getMonitor() { - return HealthCheck.monitor; - } + @Override + public int getSequenceNumber() { + return 1000; + } + + @Override + public boolean afterStart(PolicyEngine engine) { + try { + HealthCheck.monitor.start(); + } catch (IllegalStateException e) { + logger.error("Healthcheck Monitor cannot be started", e); + } + + return false; + } + + @Override + public boolean afterShutdown(PolicyEngine engine) { + try { + HealthCheck.monitor.stop(); + } catch (IllegalStateException e) { + logger.error("Healthcheck Monitor cannot be stopped", e); + } + + return false; + } + + /** + * Gets the monitor. + * + * @return the healthcheck monitor + */ + public HealthCheck getMonitor() { + return HealthCheck.monitor; + } } |