Skip navigation links
1-Wire Weather Service for Java -- Server API

Package wxservice

Main engine classes for the 1-Wire Weather Service for Java.

See: Description

Package wxservice Description

Main engine classes for the 1-Wire Weather Service for Java. The main class is Service. It automatically discovers and samples installed 1-Wire weather instruments, or you can configure it for a particular set of instruments. It formats the data and posts the data to various destinations, including Weather Underground Data Exchange, WeatherBug, APRS Citizen Weather Observer Program (CWOP) and comma-delimited files, all on independent, user-defined schedules. The service exports a remote control interface so that you can monitor it in real time using a graphical user interface such as wxmonitor.Monitor.

Architecture

Service detects sensors on the 1-Wire network and creates sensor tasks, e.g., Anemometer, for each sensor it discovers or that it finds in wxservice.properties. Service also creates formatter tasks, e.g., CSV, that it finds in wxservice.properties. Formatters use instances of ISensorData, e.g., Anemometer, to process sensor data. The role of ISensorData is to convert units, compute average, minimum and maximum values for each sensor type. Each formatter task has its own instances of the various ISensorData implementations, so different formatters can work in different units (e.g., English, metric or nautical).

Service instantiates IDataExchange. Formatter tasks register IDataExchangeListeners with IDataExchange, and all listeners receive update events whenever sensor tasks post their data to IDataExchange.

Formatter tasks, sensor tasks and sensor data processors are all completely dynamic in that you can create new types and start using them without having to rebuild this package. Simply write the new components and add them to the classpath and to wxservice.properties. Tasks must implement SensorTask and sensor data processors must implement ISensorData, or extend SensorData. Tasks typically use ScheduledThreadPoolExecutor internally to schedule their activities. Formatters must implement the three-argument constructor (see example). Sensor tasks must implement the five argument constructor (see example), and may extend SensorTask.

Usage

Service runs as a Windows service or as a daemon on Linux, Unix, Solaris, etc., using the WxWeb command line.
See Also:
APRS format configuration properties, Weather Underground format configuration properties
Skip navigation links
Copyright © 2005-2013 Karl Uppiano