DESY ACOP Beans Home

com.cosylab.gui.adapters
Class FeedbackConsumerSupport

java.lang.Object
  extended by com.cosylab.gui.adapters.FeedbackConsumerSupport
All Implemented Interfaces:
AsynchronousNumberConsumer, AsynchronousObjectConsumer, AsynchronousStringConsumer, DataConsumer, NonblockingNumberConsumer, NonblockingObjectConsumer, NonblockingStringConsumer, SynchronousNumberConsumer, SynchronousObjectConsumer, SynchronousStringConsumer

public class FeedbackConsumerSupport
extends java.lang.Object
implements AsynchronousNumberConsumer, AsynchronousObjectConsumer, AsynchronousStringConsumer, SynchronousNumberConsumer, SynchronousObjectConsumer, SynchronousStringConsumer, NonblockingNumberConsumer, NonblockingObjectConsumer, NonblockingStringConsumer

FeedbackConsumerSupport is support class fo all implementators who want to implement consumer, which receives requests for data change from data consumers and displayers.

Since:
Apr 7, 2004.
Version:
$Id: FeedbackConsumerSupport.java,v 1.4 2008-04-22 12:31:02 jbobnar Exp $
Author:
Igor Kriznar
See Also:
CommonDisplayer

Field Summary
protected  java.lang.String name
           
 
Constructor Summary
FeedbackConsumerSupport()
          Creates new instance.
 
Method Summary
 DataConsumer getDataConsumer(java.lang.Class type)
           Returns data consumer for requested data consumer type.
 DataConsumer getDefaultDataConsumer()
          Returns the implementation of default consumer type supported by this data consumer.
 java.lang.String getName()
          Returns name of this data consumer.
 java.lang.String[] getSupportedCharacteristics()
          Resturns array with names of supported characteristics.
 java.lang.Class[] getSupportedConsumerTypes()
          Returns array of supported data consumer types, which can be used as parameter and returnned with getDataCosnumer(Class) method.
 void setCharacteristics(java.util.Map characteristics)
          Sets new dynamic value characteristics to this data consumer.
 void updateAcynchronously(UpdateRequest request)
          Forwards call to updateRequest() and replays to request when update finishes.
 void updateDataState(DataState state)
          Push data state (quality) update change for dynamic value.
 void updateNonblocking(java.lang.Number value)
          Forwards call to updateRequest().
 void updateNonblocking(java.lang.Object value)
          Forwards call to updateRequest().
 void updateNonblocking(java.lang.String value)
          Forwards call to updateRequest().
protected  void updateRequest(long timestamp, java.lang.Number value)
          This method is called whenever any of number updates is called.
protected  void updateRequest(long timestamp, java.lang.Object value)
          This method is called whenever any of Object updates is called.
protected  void updateRequest(long timestamp, java.lang.String value)
          This method is called whenever any of String updates is called.
 void updateSynchronously(long timestamp, java.lang.Number value)
          Forwards call to updateRequest().
 void updateSynchronously(long timestamp, java.lang.Object value)
          Forwards call to updateRequest().
 void updateSynchronously(long timestamp, java.lang.String value)
          Forwards call to updateRequest().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Constructor Detail

FeedbackConsumerSupport

public FeedbackConsumerSupport()
Creates new instance.

Method Detail

updateAcynchronously

public void updateAcynchronously(UpdateRequest request)
                          throws CommonException
Forwards call to updateRequest() and replays to request when update finishes.

Specified by:
updateAcynchronously in interface AsynchronousNumberConsumer
Specified by:
updateAcynchronously in interface AsynchronousObjectConsumer
Specified by:
updateAcynchronously in interface AsynchronousStringConsumer
Parameters:
request - the update request, holds UpdateRequestlistener which asynchronously receives reponse
Throws:
CommonException
See Also:
AsynchronousStringConsumer.updateAcynchronously(com.cosylab.gui.displayers.UpdateRequest)

updateSynchronously

public void updateSynchronously(long timestamp,
                                java.lang.Number value)
                         throws CommonException
Forwards call to updateRequest().

Specified by:
updateSynchronously in interface SynchronousNumberConsumer
Parameters:
timestamp - the time of dynamic value event
value - new value
Throws:
CommonException
See Also:
SynchronousNumberConsumer.updateSynchronously(long, java.lang.Number)

updateSynchronously

public void updateSynchronously(long timestamp,
                                java.lang.Object value)
                         throws CommonException
Forwards call to updateRequest().

Specified by:
updateSynchronously in interface SynchronousObjectConsumer
Parameters:
timestamp - the time of dynamic value event
value - new value
Throws:
CommonException
See Also:
SynchronousObjectConsumer.updateSynchronously(long, java.lang.Object)

updateSynchronously

public void updateSynchronously(long timestamp,
                                java.lang.String value)
                         throws CommonException
Forwards call to updateRequest().

Specified by:
updateSynchronously in interface SynchronousStringConsumer
Parameters:
timestamp - the time of dynamic value event
value - new value
Throws:
CommonException
See Also:
SynchronousStringConsumer.updateSynchronously(long, java.lang.String)

updateNonblocking

public void updateNonblocking(java.lang.Number value)
Forwards call to updateRequest().

Specified by:
updateNonblocking in interface NonblockingNumberConsumer
Parameters:
value - new value
See Also:
NonblockingNumberConsumer.updateNonblocking(java.lang.Number)

updateNonblocking

public void updateNonblocking(java.lang.Object value)
Forwards call to updateRequest().

Specified by:
updateNonblocking in interface NonblockingObjectConsumer
Parameters:
value - new value
See Also:
NonblockingObjectConsumer.updateNonblocking(java.lang.Object)

updateNonblocking

public void updateNonblocking(java.lang.String value)
Forwards call to updateRequest().

Specified by:
updateNonblocking in interface NonblockingStringConsumer
Parameters:
value - new value
See Also:
NonblockingStringConsumer.updateNonblocking(java.lang.String)

getDataConsumer

public DataConsumer getDataConsumer(java.lang.Class type)
Description copied from interface: DataConsumer

Returns data consumer for requested data consumer type. If this data consumer does not support required data consumer, null is returned.

If this data cosnumer does not support specific data consumer type, then it means, that it is not desirable to cast data of that type to any by this consumer supported data consumer types.

Specified by:
getDataConsumer in interface DataConsumer
Parameters:
type - Class of specific data consumer (e.g. DoubleConsumer)
Returns:
implementation of required data consumer or null if not supported

getDefaultDataConsumer

public DataConsumer getDefaultDataConsumer()
Description copied from interface: DataConsumer
Returns the implementation of default consumer type supported by this data consumer.

Specified by:
getDefaultDataConsumer in interface DataConsumer
Returns:
the implementation of default consumer type supported by this data consumer

updateDataState

public void updateDataState(DataState state)
Description copied from interface: DataConsumer
Push data state (quality) update change for dynamic value. Usually called by data source.

Specified by:
updateDataState in interface DataConsumer
Parameters:
state - new data state(quality) descriptor

setCharacteristics

public void setCharacteristics(java.util.Map characteristics)
Description copied from interface: DataConsumer
Sets new dynamic value characteristics to this data consumer. This is usually called only at initializaation, before first data state or value is updated. Usually carries characteristics such as value minimum or maximum. Name and meaning of atributes is defined with contract betwean data consumer and source implementation.

Specified by:
setCharacteristics in interface DataConsumer
Parameters:
characteristics - the Map with attri

getName

public java.lang.String getName()
Description copied from interface: DataConsumer
Returns name of this data consumer.

Specified by:
getName in interface DataConsumer
Returns:
the name of this data consumer

getSupportedCharacteristics

public java.lang.String[] getSupportedCharacteristics()
Description copied from interface: DataConsumer
Resturns array with names of supported characteristics. Data source can use this method to optimize setting characteristics to this data consumer. If arrray of length 0 is return, then consumer does not need or support any characteristic. If null is returned, than consumer expect all existing characteristics from data source.

Specified by:
getSupportedCharacteristics in interface DataConsumer
Returns:
array with names of supported characteristics

getSupportedConsumerTypes

public java.lang.Class[] getSupportedConsumerTypes()
Description copied from interface: DataConsumer
Returns array of supported data consumer types, which can be used as parameter and returnned with getDataCosnumer(Class) method.

Specified by:
getSupportedConsumerTypes in interface DataConsumer
Returns:
array of supported data consumer types

updateRequest

protected void updateRequest(long timestamp,
                             java.lang.Number value)
This method is called whenever any of number updates is called.

Parameters:
timestamp -
value -

updateRequest

protected void updateRequest(long timestamp,
                             java.lang.Object value)
This method is called whenever any of Object updates is called.

Parameters:
timestamp -
value -

updateRequest

protected void updateRequest(long timestamp,
                             java.lang.String value)
This method is called whenever any of String updates is called.

Parameters:
timestamp -
value -


Copyright © 2010. All Rights Reserved.