diff options
author | Manoop Talasila <talasila@research.att.com> | 2019-08-13 18:20:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-08-13 18:20:45 +0000 |
commit | b90e14ca265fbecf60a8723dfdc603a28cca3e69 (patch) | |
tree | a749f687f9e37a5a47c8dcd059fd4eb53a7a90e7 /ecomp-portal-BE-common/src | |
parent | ce4168507593e3f89fe2e98735b848b51d53d532 (diff) | |
parent | 55e5a4959170392857aa8ad95e50a49488f2d409 (diff) |
Merge "NotificationCleanupConfig class fix"
Diffstat (limited to 'ecomp-portal-BE-common/src')
-rw-r--r-- | ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java index f18dea93..c32650e2 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java @@ -40,6 +40,7 @@ */ package org.onap.portalapp.config; +import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.annotation.Bean; @@ -51,23 +52,25 @@ import java.util.TimerTask; @Configuration public class NotificationCleanupConfig implements ApplicationContextAware { - + // Once every 10 minutes should be adequate - public static final int CLEANUP_PERIOD_MINUTES = 10; - + private static final int CLEANUP_PERIOD_MINUTES = 10; + private static ApplicationContext applicationContext; - public void setApplicationContext(ApplicationContext context) { - applicationContext = context; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + NotificationCleanupConfig.applicationContext = applicationContext; } - public static ApplicationContext getApplicationContext() { + static ApplicationContext getApplicationContext() { return applicationContext; } @PostConstruct - public void StartSchedular() { + public void startSchedular() { TimerTask task = new NotificationCleanup(); Timer timer = new Timer(); timer.schedule(task, 1000, (long) CLEANUP_PERIOD_MINUTES * 60 * 1000); @@ -77,5 +80,4 @@ public class NotificationCleanupConfig implements ApplicationContextAware { public NotificationCleanupConfig getConfig() { return new NotificationCleanupConfig(); } - }
\ No newline at end of file |