From e4aeaa79f1f199d960a113d5d9b774c6704bce42 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Thu, 20 Feb 2014 12:31:21 -0600 Subject: [PATCH] Issue #2824 Registered with SiteAwareRegistry so we can stop fetching when site is deactivated. Change-Id: I4e277656a971e7927aa2321e91ba7304351f9405 Former-commit-id: 6ccf6a56e793dc3a2227c6088a9bcb671fc770dc [formerly a2b2a15f1ef8e237058f1760d64021895ae27c35] Former-commit-id: 6a7e4a147d94eac904b44178a5833d45551b9016 --- .../activetable/vtecsharing/FetchActiveTableSrv.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/vtecsharing/FetchActiveTableSrv.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/vtecsharing/FetchActiveTableSrv.java index 93cf8667d2..188d479124 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/vtecsharing/FetchActiveTableSrv.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/vtecsharing/FetchActiveTableSrv.java @@ -37,7 +37,9 @@ import com.google.common.util.concurrent.MoreExecutors; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.common.util.registry.RegistryException; import com.raytheon.uf.edex.site.ISiteActivationListener; +import com.raytheon.uf.edex.site.SiteAwareRegistry; /** * Service that fetches neighboring sites' active table entries that are @@ -51,6 +53,8 @@ import com.raytheon.uf.edex.site.ISiteActivationListener; * ------------ ---------- ----------- -------------------------- * Feb 28, 2013 dgilling Initial creation * Feb 20, 2014 #2824 randerso Changed log level of message when activating FetchAT + * Registered with SiteAwareRegistry so we can stop + * fetching when site is deactivated. * * * @@ -75,6 +79,13 @@ public class FetchActiveTableSrv implements ISiteActivationListener { jobExecutor = MoreExecutors .getExitingScheduledExecutorService((ScheduledThreadPoolExecutor) Executors .newScheduledThreadPool(1)); + + try { + SiteAwareRegistry.getInstance().register(this); + } catch (RegistryException e) { + statusHandler.handle(Priority.PROBLEM, + "Error registering with SiteAwareRegistry", e); + } } public void addSite(Map configData) {