org.epics.pvmanager
Class PVReaderConfiguration<T>

java.lang.Object
  extended by org.epics.pvmanager.PVReaderConfiguration<T>
Type Parameters:
T - the type of the expression

public class PVReaderConfiguration<T>
extends Object

An expression used to set the final parameters on how the pv expression should be monitored.

Author:
carcassi

Method Summary
 PVReader<T> every(TimeDuration period)
          Sets the rate of scan of the expression and creates the actual PVReader object that can be monitored through listeners.
 PVReaderConfiguration<T> from(DataSource dataSource)
          Defines which DataSource should be used to read the data.
 PVReaderConfiguration<T> notifyOn(Executor onThread)
          Defines on which thread the PVManager should notify the client.
 PVReaderConfiguration<T> routeExceptionsTo(ExceptionHandler exceptionHandler)
          Forwards exception to the given exception handler.
 PVReaderConfiguration<T> timeout(TimeDuration timeout)
           
 PVReaderConfiguration<T> timeout(TimeDuration timeout, String timeoutMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

from

public PVReaderConfiguration<T> from(DataSource dataSource)
Defines which DataSource should be used to read the data.

Parameters:
dataSource - a connection manager
Returns:
this

notifyOn

public PVReaderConfiguration<T> notifyOn(Executor onThread)
Defines on which thread the PVManager should notify the client.

Parameters:
onThread - the thread on which to notify
Returns:
this

timeout

public PVReaderConfiguration<T> timeout(TimeDuration timeout)

timeout

public PVReaderConfiguration<T> timeout(TimeDuration timeout,
                                        String timeoutMessage)

routeExceptionsTo

public PVReaderConfiguration<T> routeExceptionsTo(ExceptionHandler exceptionHandler)
Forwards exception to the given exception handler. No thread switch is done, so the handler is notified on the thread where the exception was thrown.

Giving a custom exception handler will disable the default handler, so PVReader.lastException() is no longer set and no notification is done.

Parameters:
exceptionHandler - an exception handler
Returns:
this

every

public PVReader<T> every(TimeDuration period)
Sets the rate of scan of the expression and creates the actual PVReader object that can be monitored through listeners.

Parameters:
period - the minimum time distance (i.e. the maximum rate) at which notifications should be sent
Returns:
the PVReader


Copyright © 2011. All Rights Reserved.