public class Watchdog
extends java.lang.Object
Refer to this internal default resource file for property keys and default values used to configure this formatter. The default command is "resetWxService", which will cause WxService to re-initialize the 1-Wire network, and all sensor and formatter tasks. The watchdog can also run operating system commands, such as "shutdown -r", which is the Windows command to restart the computer.
Modifier and Type | Class and Description |
---|---|
private class |
Watchdog.DataExchangeListener
Data exchange listener captures and processes sensor data.
|
private class |
Watchdog.FormatTask
Checks for received data.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
command
Command to execute on no data.
|
private IDataExchange |
dataExchange
Data exchange for receiving data.
|
private boolean |
hasData
Flag to indicate data was received.
|
private static java.lang.String |
INITIALIZE_SERVICE_COMMMAND
Initialize service command.
|
private long |
interval
Posting interval.
|
private IDataExchangeListener |
listener
Listener for receiving data added events.
|
private static java.util.logging.Logger |
LOGGER
Watchdog formatter logger.
|
private java.lang.String |
name
Task name.
|
private IServiceControl |
serviceControl
Service control to reset the service after an extended timeout.
|
Constructor and Description |
---|
Watchdog(java.lang.String name,
java.util.Properties config,
IDataExchange dataExchange,
IServiceControl serviceControl)
Creates a new instance of Watchdog
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
Returns a text representation of this object.
|
private static final java.util.logging.Logger LOGGER
private static final java.lang.String INITIALIZE_SERVICE_COMMMAND
private java.lang.String name
private IServiceControl serviceControl
private IDataExchange dataExchange
private final IDataExchangeListener listener
private long interval
private java.lang.String command
private boolean hasData
public Watchdog(java.lang.String name, java.util.Properties config, IDataExchange dataExchange, IServiceControl serviceControl)
name
- of this formatter task.config
- properties from the wxservice.properties file.dataExchange
- formatters implement an
IDataExchangeListener
as an inner class and add an
instance to IDataExchange
.serviceControl
- IServiceControl
to initialize the
service.