Chapter 16. The SensorShell

Table of Contents

16.1. Introduction
16.2. Requirements for the SensorShell
16.3. The interactive interface to SensorShell
16.4. Offline data storage
16.5. The Java interface to SensorShell
16.6. The .NET interface to SensorShell

16.1. Introduction

Early on in the development of Hackystat, we realized that many client-side Hackystat sensors faced similar infrastructure problems to solve, including the implementation of the SOAP protocols for transmission of data to the server, the buffering of sensor data instances to reduce transmission overhead, local caching when off-line, and so forth. Rather than require each sensor to implement these features, we created a client-side application called the "SensorShell" that is intended to simplify the implementation of Hackystat sensors by providing a generic implementation of these features.

Since sensors can be written in many different languages and environments, the SensorShell provides a variety of interfaces. The most basic interface is an interactive command line loop. This chapter uses that interface to demonstrate the features of the SensorShell. This interactive interface is used directly by some sensors, such as the Emacs sensor, which creates a subprocess, invokes the sensorshell interactively, and sends strings to this subprocess to collect and transmit sensor data.

The SensorShell is written in Java, and so Java-based sensors can use the public Java API to create SensorShell instances and invoke its methods to send sensor data. The Eclipse and JBuilder sensors are among those that use the Java interface.

A third interface is a .NET wrapper for the SensorShell. This provides a way for .NET languages such as C# to communicate more easily with an underlying Java SensorShell subprocess. The Office and Visual Studio sensors are among those that use the .NET interface.

Figure 16.1, “ SensorShell in the architecture of Hackystat ” illustrates how the SensorShell provides an architectural middleware component for the flow of data in Hackystat.

Figure 16.1.  SensorShell in the architecture of Hackystat


SensorShell in the architecture of Hackystat

This chapter provides an introduction to the SensorShell geared toward the needs of developers who wish to write sensors for Hackystat. In the next section, we explain some of the common problems faced by sensor writers and how the SensorShell solves them.