org.epics.pvmanager
Class DataSource.ValueProcessor<P,V>

java.lang.Object
  extended by org.epics.pvmanager.DataSource.ValueProcessor<P,V>
Type Parameters:
P - event payload type
V - requested value type
Enclosing class:
DataSource

public abstract static class DataSource.ValueProcessor<P,V>
extends java.lang.Object

Helper class that contains the logic for processing a new value. It takes care of locking the collector and calling the disconnect when appropriate.


Constructor Summary
DataSource.ValueProcessor(Collector collector, ValueCache<V> cache, ExceptionHandler exceptionHandler)
          Creates a value processor using the collector and the value cache given.
 
Method Summary
abstract  void close()
          Called by the framework if this callback is no longer needed.
 void processValue(P payload)
          Processes the given payload, by locking the collector, updating the cache and notifying the collector.
abstract  boolean updateCache(P payload, ValueCache<V> cache)
          Implements the update of the cache given the protocol specific payload.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSource.ValueProcessor

public DataSource.ValueProcessor(Collector collector,
                                 ValueCache<V> cache,
                                 ExceptionHandler exceptionHandler)
Creates a value processor using the collector and the value cache given.

Parameters:
collector - collector to notify of updates
cache - cache where to put the new data
exceptionHandler - where to forward exceptions
Method Detail

processValue

public final void processValue(P payload)
Processes the given payload, by locking the collector, updating the cache and notifying the collector.

Parameters:
payload - payload for the data source specific event

close

public abstract void close()
Called by the framework if this callback is no longer needed.


updateCache

public abstract boolean updateCache(P payload,
                                    ValueCache<V> cache)
Implements the update of the cache given the protocol specific payload.

Parameters:
payload - the payload of the notification
cache - the cache to update
Returns:
true if an update is needed; false if not


Copyright © 2011. All Rights Reserved.