DESY ACOP Beans Home

de.desy.acop.transport.adapters
Class AcopTransportDataSource

java.lang.Object
  extended by com.cosylab.gui.displayers.DataSourceSupport
      extended by de.desy.acop.transport.adapters.AcopTransportDataSource
All Implemented Interfaces:
DataSource, AcopTransportListener, java.io.Serializable, java.util.EventListener
Direct Known Subclasses:
AcopDataSourceJoint

public class AcopTransportDataSource
extends DataSourceSupport
implements AcopTransportListener

AcopTransportDataSource is a common DataSource for all TINE based connections. This class connects to the TINE CS via the AcopTransport. This data source works as a connection monitor receiving data as specified by the supplied ConnectionParameters.

Author:
Igor Kriznar (igor.kriznarATcosylab.com)
See Also:
Serialized Form

Field Summary
protected  double[] data
           
protected  ObjectList dcon
           
protected  java.lang.String[] objectData
           
protected  ObjectList scon
           
protected  ObjectList sseqcon
           
 
Fields inherited from class com.cosylab.gui.displayers.DataSourceSupport
types
 
Constructor Summary
AcopTransportDataSource()
          Creates new instance of AcopTransportDataSource.
 
Method Summary
 void addConsumer(DataConsumer consumer)
          This support implementation does not perform any type check on consumer, it just adds it to list of consumers.
 void clear()
          Releases all consumers and goes into initial state.
 void connect(ConnectionParameters conn)
          Connects this data source to the TINE channel.
 void dataEventReceived(AcopTransportEvent e)
           
 void disconnect()
          Disconnects this data source from the remote TINE channel.
 java.util.Map<java.lang.String,java.lang.Object> getCharacteristics()
          Returns the characteristics that belong to the property specified by the ConnectionParameters attached to this data source.
 ConnectionParameters getConnectionParameters()
          Returns the ConnectionParameters attached to this data source.
protected  de.desy.tine.definitions.TFormat getDataFormat()
          Returns the format.
protected  int getDataLength()
          Returns the length of data received from the remote channel.
protected  ReverseConsumer getReverseConsumer()
          Returns the consumer that is attached to the displayer and enables setting value on the channel specified by the ConnectionParameters of this data source.
 AcopTransport getTransport()
          Returns the transport used by this data source.
 void removeConsumer(DataConsumer consumer)
          Removes the DataConsumer from this data source.
protected  void setDataFormat(de.desy.tine.definitions.TFormat format)
          Sets new format.
 
Methods inherited from class com.cosylab.gui.displayers.DataSourceSupport
clone, extractSupportedCharacteristics, getAcceptableConsumerTypes, getConsumers, removeAllConsumers
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dcon

protected ObjectList dcon

scon

protected ObjectList scon

sseqcon

protected ObjectList sseqcon

data

protected double[] data

objectData

protected java.lang.String[] objectData
Constructor Detail

AcopTransportDataSource

public AcopTransportDataSource()
Creates new instance of AcopTransportDataSource.

Method Detail

addConsumer

public void addConsumer(DataConsumer consumer)
                 throws java.beans.PropertyVetoException
Description copied from class: DataSourceSupport
This support implementation does not perform any type check on consumer, it just adds it to list of consumers.

Specified by:
addConsumer in interface DataSource
Overrides:
addConsumer in class DataSourceSupport
Parameters:
consumer - the data consumer to be regitered at this data source
Throws:
java.beans.PropertyVetoException
See Also:
DataSource.addConsumer(com.cosylab.gui.displayers.DataConsumer)

getCharacteristics

public java.util.Map<java.lang.String,java.lang.Object> getCharacteristics()
                                                                    throws ConnectionFailed
Returns the characteristics that belong to the property specified by the ConnectionParameters attached to this data source.

Returns:
a Map of all characteristics, where keys are the name of the characteristics and values are characteristics
Throws:
ConnectionFailed - if property information query failed
See Also:
DataSourceUtilities.getCharacteristics(ConnectionParameters)

getTransport

public AcopTransport getTransport()
Returns the transport used by this data source.

Returns:
the transport

getConnectionParameters

public ConnectionParameters getConnectionParameters()
Returns the ConnectionParameters attached to this data source.

Returns:
the connection parameters

connect

public void connect(ConnectionParameters conn)
             throws ConnectionFailed
Connects this data source to the TINE channel.

Parameters:
conn - parameters specifiyng the connection channel
Throws:
ConnectionFailed - if remote connection failed

disconnect

public void disconnect()
Disconnects this data source from the remote TINE channel.


dataEventReceived

public void dataEventReceived(AcopTransportEvent e)
Specified by:
dataEventReceived in interface AcopTransportListener

getReverseConsumer

protected ReverseConsumer getReverseConsumer()
Returns the consumer that is attached to the displayer and enables setting value on the channel specified by the ConnectionParameters of this data source.

Returns:

clear

public void clear()
Description copied from class: DataSourceSupport
Releases all consumers and goes into initial state.

Overrides:
clear in class DataSourceSupport

getDataFormat

protected de.desy.tine.definitions.TFormat getDataFormat()
Returns the format.

Returns:
Returns the format.

setDataFormat

protected void setDataFormat(de.desy.tine.definitions.TFormat format)
Sets new format.

Parameters:
format - The format to set.

removeConsumer

public void removeConsumer(DataConsumer consumer)
Removes the DataConsumer from this data source.

Specified by:
removeConsumer in interface DataSource
Overrides:
removeConsumer in class DataSourceSupport
Parameters:
consumer - data consumer to be deregistered

getDataLength

protected int getDataLength()
Returns the length of data received from the remote channel.

Returns:


Copyright © 2010. All Rights Reserved.