|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--context.arch.BaseObject | +--context.arch.widget.Widget | +--context.arch.widget.WTemperature
This class is a context widget that provides information on the temperature in a particular location. The information is in the form of a location, temperature, and units (Celsius or Fahrenheit). It has the following callbacks: UPDATE. It supports polling and subscriptions.
Widget
,
TemperatureSensor
Field Summary | |
static java.lang.String |
CLASSNAME
Name of widget |
static int |
DEFAULT_PORT
The default port this widget runs on is 5100 |
static java.lang.String |
LOCATION
Tag for user location |
protected TemperatureSensor |
temp
|
static java.lang.String |
TEMPERATURE
Tag for temperature |
static java.lang.String |
UNITS
Tag for temperature units |
java.lang.String |
VERSION_NUMBER
Widget version number |
Fields inherited from class context.arch.widget.Widget |
attributes,
attributeTypes,
callbacks,
CLASS,
CurrentOffset,
DEFAULT_PORT,
id,
PUT_DATA,
PUT_DATA_REPLY,
QUERY,
QUERY_ATTRIBUTES,
QUERY_ATTRIBUTES_REPLY,
QUERY_CALLBACKS,
QUERY_CALLBACKS_REPLY,
QUERY_REPLY,
QUERY_SERVICES,
QUERY_SERVICES_REPLY,
QUERY_VERSION,
QUERY_VERSION_REPLY,
services,
SPACER,
storage,
subscribers,
TIMESTAMP,
UPDATE,
UPDATE_AND_QUERY,
UPDATE_AND_QUERY_REPLY,
VERSION,
VERSION_NUMBER |
Fields inherited from class context.arch.BaseObject |
communications,
EXIT_OK,
handlers,
ID,
parser,
PING,
PING_REPLY,
serviceHandlers |
Constructor Summary | |
WTemperature(java.lang.String location)
Constructor that creates the widget at the given location and monitors communications on the DEFAULT_PORT and creates an instance of the TemperatureSensor generator. |
|
WTemperature(java.lang.String location,
boolean storageFlag)
Constructor that creates the widget at the given location and monitors communications on the DEFAULT_PORT and creates an instance of the TemperatureSensor generator. |
|
WTemperature(java.lang.String location,
int port)
Constructor that creates the widget at the given location and monitors communications on the given port and creates an instance of the TemperatureSensor generator. |
|
WTemperature(java.lang.String location,
int port,
boolean storageFlag)
Constructor that creates the widget at the given location and monitors communications on the given port and creates an instance of the TemperatureSensor generator. |
|
WTemperature(java.lang.String location,
int port,
java.lang.String id,
boolean storageFlag)
Constructor that creates the widget at the given location and monitors communications on the given port and creates an instance of the TemperatureSensor generator. |
Method Summary | |
static void |
main(java.lang.String[] argv)
Main method to create a widget with location and port specified by command line arguments |
void |
notify(java.lang.String event,
java.lang.Object data)
Called by the generator class when a significant event has occurred. |
protected AttributeNameValues |
queryGenerator()
This method returns an empty AttributeNameValues object. |
protected Attributes |
setAttributes()
This method implements the abstract method Widget.setAttributes(). |
protected Callbacks |
setCallbacks()
This method implements the abstract method Widget.setCallbacks(). |
protected Services |
setServices()
This method implements the abstract method Widget.setServices(). |
protected AttributeNameValues |
TemperatureData2Attributes(TemperatureData data)
This method converts the TemperatureData object to an AttributeNameValues object. |
Methods inherited from class context.arch.widget.Widget |
addSubscriber,
canHandle,
canHandle,
canHandle,
canHandle,
executeService,
getAttributeType,
getCurrentTime,
getNewOffset,
getNewOffsetNoDelay,
isAttribute,
isCallback,
processCallbackReply,
putData,
queryAttributes,
queryCallbacks,
queryServices,
queryWidget,
removeSubscriber,
retrieveData,
runUserMethod,
runWidgetMethod,
sendToSubscribers,
setAttribute,
store,
store,
updateWidgetInformation |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public java.lang.String VERSION_NUMBER
public static final java.lang.String TEMPERATURE
public static final java.lang.String UNITS
public static final java.lang.String LOCATION
public static final java.lang.String CLASSNAME
public static final int DEFAULT_PORT
protected TemperatureSensor temp
Constructor Detail |
public WTemperature(java.lang.String location)
location
- Location the widget is "monitoring"TemperatureSensor
public WTemperature(java.lang.String location, boolean storageFlag)
location
- Location the widget is "monitoring"storageFlag
- Flag to indicate whether or not to enable storage functionalityTemperatureSensor
public WTemperature(java.lang.String location, int port)
location
- Location the widget is "monitoring"port
- Port to run the widget onTemperatureSensor
public WTemperature(java.lang.String location, int port, boolean storageFlag)
location
- Location the widget is "monitoring"port
- Port to run the widget onstorageFlag
- Flag to indicate whether or not to enable storage functionalityTemperatureSensor
public WTemperature(java.lang.String location, int port, java.lang.String id, boolean storageFlag)
location
- Location the widget is "monitoring"port
- Port to run the widget onstorageFlag
- Flag to indicate whether or not to enable storage functionalityTemperatureSensor
Method Detail |
protected Attributes setAttributes()
protected Callbacks setCallbacks()
protected Services setServices()
protected AttributeNameValues queryGenerator()
public void notify(java.lang.String event, java.lang.Object data)
event
- Name of the event that has occurreddata
- Object containing relevant event dataWidget.sendToSubscribers(String, AttributeNameValues)
,
Widget.store(AttributeNameValues)
protected AttributeNameValues TemperatureData2Attributes(TemperatureData data)
data
- TemperatureData object to be convertedpublic static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |