Package org.somda.sdc.glue.consumer
Class SdcRemoteDeviceWatchdog
java.lang.Object
com.google.common.util.concurrent.AbstractIdleService
org.somda.sdc.glue.consumer.SdcRemoteDeviceWatchdog
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
public class SdcRemoteDeviceWatchdog
extends com.google.common.util.concurrent.AbstractIdleService
Sends WS-Eventing Renew or DirectedProbe requests and informs in case of an error.
SdcRemoteDeviceWatchdog is a Guava service that requests a remote device in a given periodicity once started.
- If at least one subscription exists, SdcRemoteDeviceWatchdog tries to renew this subscription in order to check if the remote device is still reachable.
- If multiple subscriptions exist, all are renewed.
- If no subscription exists, SdcRemoteDeviceWatchdog sends a directed probe.
ConsumerConfig#WATCHDOG_PERIOD * 3.
Watchdog events are distributed only if the service is running.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterObserver(WatchdogObserver watchdogObserver) Registers a watchdog observer.protected voidshutDown()protected voidstartUp()voidunregisterObserver(WatchdogObserver watchdogObserver) Unregisters a watchdog observer.Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, startAsync, state, stopAsync, toString
-
Method Details
-
registerObserver
Registers a watchdog observer.- Parameters:
watchdogObserver- the watchdog observer.
-
unregisterObserver
Unregisters a watchdog observer.- Parameters:
watchdogObserver- the watchdog observer.
-
startUp
protected void startUp()- Specified by:
startUpin classcom.google.common.util.concurrent.AbstractIdleService
-
shutDown
protected void shutDown()- Specified by:
shutDownin classcom.google.common.util.concurrent.AbstractIdleService
-