org.mbari.siam.foce.devices.controlLoop
Class RegistryInputConnector

java.lang.Object
  extended by org.mbari.siam.foce.devices.controlLoop.InputConnector
      extended by org.mbari.siam.foce.devices.controlLoop.RegistryInputConnector
All Implemented Interfaces:
java.rmi.Remote, ControlInputIF, InstrumentDataListener

public class RegistryInputConnector
extends InputConnector
implements InstrumentDataListener, ControlInputIF

Connects a FilterInput to a SIAM registry data stream


Field Summary
protected static org.apache.log4j.Logger _log4j
          Log4j logger
 
Fields inherited from class org.mbari.siam.foce.devices.controlLoop.InputConnector
DEFAULT_ID, DEFAULT_UPDATE_TIMEOUT
 
Fields inherited from interface org.mbari.siam.distributed.devices.ControlInputIF
FIELD_TYPE_BOOLEAN, FIELD_TYPE_BYTE, FIELD_TYPE_DOUBLE, FIELD_TYPE_FLOAT, FIELD_TYPE_INT, FIELD_TYPE_LONG, FIELD_TYPE_SHORT, STATE_CONNECTING, STATE_DISCONNECTING, STATE_INITIALIZED, STATE_INSTANTIATED, STATE_UPDATING, STATE_WAITING, STATUS_CONNECT_ERROR, STATUS_DISCONNECT_ERROR, STATUS_ERROR, STATUS_MASK_ALL, STATUS_NOT_CONNECTED, STATUS_OK, STATUS_TIMEOUT_EXPIRED, STATUS_UPDATE_ERROR
 
Constructor Summary
RegistryInputConnector(java.lang.String registryKey, java.lang.String fieldKey, int dataType, FilterInput input, int id, long updateTimeoutMsec)
          Constructor
RegistryInputConnector(java.lang.String registryKey, java.lang.String fieldKey, int dataType, FilterInput input, long updateTimeoutMsec)
           
 
Method Summary
 void connect()
          get control input value (ControlInputIF)
 void dataCallback(DevicePacket sensorData, PacketParser.Field[] fields)
          dataCallback for all services with which we are registered as data listeners.
 void disconnect()
          disconnect from data source
 Instrument findService()
           
 void initialize()
          initialize control input (ControlInputIF)
protected  void registerCallbacks()
          Attempts to register services.
 void serviceRegisteredCallback(RegistryEntry entry)
          Callback for InstrumentDataListener interface, called when the services register with the InstrumentRegistry
 
Methods inherited from class org.mbari.siam.foce.devices.controlLoop.InputConnector
clearStatus, dataType, getFilterInput, getInputID, getInputState, getInputValue, getService, getState, getStatus, getUpdateTimeout, getValidator, id, setFilterInput, setInputID, setLastUpdateTime, setService, setState, setStatus, setUpdateTimeout, setValidator, stateString, stateString, statusString, statusString, timeSinceLastUpdate, typeName, updateTimeoutExpired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mbari.siam.distributed.devices.ControlInputIF
getFilterInput, getInputID, getInputState, getInputValue, getService, getState, getStatus, getUpdateTimeout, getValidator, setFilterInput, setInputID, setLastUpdateTime, setService, setUpdateTimeout, setValidator, stateString, statusString, timeSinceLastUpdate, updateTimeoutExpired
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j
Log4j logger

Constructor Detail

RegistryInputConnector

public RegistryInputConnector(java.lang.String registryKey,
                              java.lang.String fieldKey,
                              int dataType,
                              FilterInput input,
                              long updateTimeoutMsec)
                       throws InvalidPropertyException
Throws:
InvalidPropertyException

RegistryInputConnector

public RegistryInputConnector(java.lang.String registryKey,
                              java.lang.String fieldKey,
                              int dataType,
                              FilterInput input,
                              int id,
                              long updateTimeoutMsec)
                       throws InvalidPropertyException
Constructor

Throws:
InvalidPropertyException
Method Detail

initialize

public void initialize()
                throws java.rmi.RemoteException
initialize control input (ControlInputIF)

Specified by:
initialize in interface ControlInputIF
Specified by:
initialize in class InputConnector
Throws:
java.rmi.RemoteException

connect

public void connect()
             throws java.lang.Exception,
                    java.rmi.RemoteException
get control input value (ControlInputIF)

Specified by:
connect in interface ControlInputIF
Specified by:
connect in class InputConnector
Throws:
java.lang.Exception
java.rmi.RemoteException

disconnect

public void disconnect()
                throws java.lang.Exception,
                       java.rmi.RemoteException
Description copied from class: InputConnector
disconnect from data source

Specified by:
disconnect in interface ControlInputIF
Specified by:
disconnect in class InputConnector
Throws:
java.lang.Exception
java.rmi.RemoteException

serviceRegisteredCallback

public void serviceRegisteredCallback(RegistryEntry entry)
Callback for InstrumentDataListener interface, called when the services register with the InstrumentRegistry

Specified by:
serviceRegisteredCallback in interface InstrumentDataListener

dataCallback

public void dataCallback(DevicePacket sensorData,
                         PacketParser.Field[] fields)
dataCallback for all services with which we are registered as data listeners. When data packets arrive, this method extracts the relevant data and prepares it. Some of the data is dropped into filters, and other data is used directly to set the value of various control loop parameters.

Specified by:
dataCallback in interface InstrumentDataListener
Parameters:
sensorData - - SensorDataPacket that instrument logged
fields - - Result of passing sensorData to PacketParser.parseFields() if registered DeviceService is an instanceof BaseInstrumentService. Else null.

findService

public Instrument findService()

registerCallbacks

protected void registerCallbacks()
Attempts to register services. Services already registered are not registered again. Services that are not found should be put on a list and registered when they become available. Logs messages when services are not registered.



Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.