1.0.0

org.eclipse.soda.dk.measurement
Class Measurements

java.lang.Object
  extended by org.eclipse.soda.dk.core.EscObject
      extended by org.eclipse.soda.dk.device.Control
          extended by org.eclipse.soda.dk.measurement.Measurement
              extended by org.eclipse.soda.dk.measurement.Measurements
All Implemented Interfaces:
ControlService, MeasurementListener, MeasurementService, ErrorListener

public class Measurements
extends Measurement
implements MeasurementListener

The Measurements class implements the MeasurementService interface.

Version:
1.0.0
See Also:
Control, Measurement, ControlService, ErrorListener, MeasurementService, MeasurementListener, MessageHandler

Field Summary
 
Fields inherited from class org.eclipse.soda.dk.device.Control
EXCEPTION_READ_FAILED_RESOURCE, SETVALUEEXCEPTION_RESOURCE
 
Fields inherited from class org.eclipse.soda.dk.core.EscObject
CLONE_EXCEPTION_RESOURCE, EMPTY_BYTES, EMPTY_STRING, ERROR_OCCURRED_EXCEPTION_RESOURCE, ID_FILTER_KEY, ID_KEY, ID_KEY_ANY, INTEGER_TABLE, KEY_KEY, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_TRACE, LOG_WARNING, PREFIX_KEY, RESOURCE_BUNDLE, SLEEP_EXCEPTION_RESOURCE, SYSTEM_INFO_RESOURCE, TO_STRING_CONFIGURATION_KEYS, TRACE_LEVEL_HIGH, TRACE_LEVEL_LOW, TRACE_LEVEL_MAX, TRACE_LEVEL_MIN, TRACE_LEVEL_NONE, TRACE_LEVEL_NORMAL, TRACELEVEL_KEY, UNKNOWN_ERROR_RESOURCE
 
Constructor Summary
Measurements(java.lang.String key, java.lang.Object value, MeasurementService[] measurements)
          Constructs an Measurements object using the input parameter(s).
 
Method Summary
 void addInternalMeasurementListener()
          Adds the specified listener to receive listener notification.
 void executeRead()
          Perform the executeRead action method.
 void executeWrite(java.lang.Object value)
          Perform the executeWrite action method.
 MeasurementService[] getMeasurements()
          Gets the org.eclipse.soda.dk.measurement.service.MeasurementService [] measurements property value.
 void measurementChanged(MeasurementService source, java.lang.Object timestamp, java.lang.Object newValue, java.lang.Object oldValue)
          This method is fired to all Listeners each time the value of the measurement changes.
 java.lang.Object read(long timeout)
          Perform the read method and return the Object result.
protected  void setMeasurements(MeasurementService[] measurements)
          Sets the measurements property.
 void setValue(java.lang.Object value)
          This method forces a synchronous write of the locally cached value.
 
Methods inherited from class org.eclipse.soda.dk.measurement.Measurement
addMeasurementListener, fireErrorOccurred, fireErrorOccurred, fireValueChanged, getMeasurementListener, getTimestamp, getUnits, getValue, getValueRaw, removeMeasurementListener, reportError, setMeasurementListener, setRawValue, setTimestamp, setValue
 
Methods inherited from class org.eclipse.soda.dk.device.Control
attemptRecoveryFromError, equalsValue, errorOccurred, getCodeKey, getErrorSeverity, getKey, getQualifiedKey, getResource, setKey, setQualifiedKey, toString
 
Methods inherited from class org.eclipse.soda.dk.core.EscObject
createDefaultLogService, createException, createException, createInteger, createIntegerTable, createNumber, format, getBoolean, getConfigurationService, getCurrentTimestamp, getDefaultLogService, getDefaultResource, getFloat, getInt, getLoadLibraryName, getLogDetails, getLogDetails0, getLogDetails1, getLogDetails2, getLogDetails3, getLogDetails4, getLogDetails5, getLogDetails6, getLogDetails7, getLogService, getLong, getObject, getOutputName, getSimpleClassName, getStaticBoolean, getStaticFloat, getStaticInt, getStaticLong, getStaticObject, getStaticString, getString, getTraceLevel, getVmLibraryVersion, handleError, handleError, handleError, handleStaticError, handleStaticException, isDebug, isTrace, loadService, log, log, report, report, report, report, report, report, reportSystemInfo, setDebug, setDefaultLogService, setLogService, setTraceLevel, shouldLog, sleep, startupEscStatic, toStringConfigurationKeys, toStringInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.soda.dk.transport.service.ErrorListener
errorOccurred
 
Methods inherited from interface org.eclipse.soda.dk.device.service.ControlService
getKey
 

Constructor Detail

Measurements

public Measurements(java.lang.String key,
                    java.lang.Object value,
                    MeasurementService[] measurements)
Constructs an Measurements object using the input parameter(s).

Parameters:
key - java.lang.String
value - java.lang.Object
measurements - org.eclipse.soda.dk.measurement.service.MeasurementService[]
See Also:
getMeasurements(), setMeasurements(MeasurementService[])
Method Detail

addInternalMeasurementListener

public void addInternalMeasurementListener()
Adds the specified listener to receive listener notification.


executeRead

public void executeRead()
Perform the executeRead action method.

Specified by:
executeRead in interface MeasurementService
Overrides:
executeRead in class Measurement
See Also:
MeasurementService.executeRead()

executeWrite

public void executeWrite(java.lang.Object value)
Perform the executeWrite action method.

Specified by:
executeWrite in interface MeasurementService
Overrides:
executeWrite in class Measurement
Parameters:
value - java.lang.Object
See Also:
MeasurementService.executeWrite(java.lang.Object)

getMeasurements

public MeasurementService[] getMeasurements()
Gets the org.eclipse.soda.dk.measurement.service.MeasurementService [] measurements property value.

Returns:
Results of the get measurements (MeasurementService[]) value.
See Also:
Measurements(String,Object,MeasurementService[]), setMeasurements(MeasurementService[])

measurementChanged

public void measurementChanged(MeasurementService source,
                               java.lang.Object timestamp,
                               java.lang.Object newValue,
                               java.lang.Object oldValue)
This method is fired to all Listeners each time the value of the measurement changes. Since other notifications are blocked until this method returns, implementors of this method should:

Specified by:
measurementChanged in interface MeasurementListener
Parameters:
source - MeasurementService which changed.
timestamp - The time at which the value change was detected.
newValue - The new value of the MeasurementService.
oldValue - The old value of the MeasurementService.

read

public java.lang.Object read(long timeout)
                      throws java.lang.RuntimeException
Perform the read method and return the Object result.

Specified by:
read in interface MeasurementService
Overrides:
read in class Measurement
Parameters:
timeout - long
Returns:
Results of the read (Object) value.
Throws:
- href="java.lang.RuntimeException.html">RuntimeException Thrown if the RuntimeException exception condition occurs.
java.lang.RuntimeException - Thrown if the read command does not result in a response from the device.
See Also:
MeasurementService.read(long)

setMeasurements

protected void setMeasurements(MeasurementService[] measurements)
Sets the measurements property.

Parameters:
measurements - The new property value (org.eclipse.soda.dk.measurement.service.MeasurementService[]).
See Also:
Measurements(String,Object,MeasurementService[]), getMeasurements()

setValue

public void setValue(java.lang.Object value)
This method forces a synchronous write of the locally cached value. This method should only be used for simulation and testing purposes, as it will insert false data into the measurement.

Specified by:
setValue in interface MeasurementService
Overrides:
setValue in class Measurement
Parameters:
value - The new property value (java.lang.Object).
See Also:
Measurement.getValue(), Measurement.setRawValue(Object,Object), Measurement.setValue(Object,Object)

1.0.0

Copyright (c) 1999, 2007 IBM