T
- the type of the expressionpublic class PVReaderConfiguration<T> extends Object
Modifier and Type | Method and Description |
---|---|
PVReaderConfiguration<T> |
from(DataSource dataSource)
Defines which DataSource should be used to read the data.
|
PVReader<T> |
maxRate(org.epics.util.time.TimeDuration rate)
Sets the rate of scan of the expression and creates the actual
PVReader
object that can be monitored through listeners. |
PVReaderConfiguration<T> |
notifyOn(Executor onThread)
Defines on which thread the PVManager should notify the client.
|
PVReaderConfiguration<T> |
readListener(PVReaderListener<? super T> listener)
Adds a listener notified for any reader event (values, connection and errors).
|
PVReaderConfiguration<T> |
routeExceptionsTo(ExceptionHandler exceptionHandler)
Forwards exception to the given exception handler.
|
PVReaderConfiguration<T> |
timeout(org.epics.util.time.TimeDuration timeout)
Sets a timeout for no values received.
|
PVReaderConfiguration<T> |
timeout(org.epics.util.time.TimeDuration timeout,
String timeoutMessage)
Sets a timeout for no values received with the given message.
|
public PVReaderConfiguration<T> from(DataSource dataSource)
dataSource
- a connection managerpublic PVReaderConfiguration<T> notifyOn(Executor onThread)
onThread
- the thread on which to notifypublic PVReaderConfiguration<T> timeout(org.epics.util.time.TimeDuration timeout)
For more details, consult timeout(org.epics.util.time.TimeDuration, java.lang.String)
.
timeout
- the duration of the timeout; can't be nullpublic PVReaderConfiguration<T> timeout(org.epics.util.time.TimeDuration timeout, String timeoutMessage)
If no value is received before the given time, a TimeoutException
is notified through the listener. Note the difference: the timeout is
not on the connection but on the value itself. This allows to use timeouts
when creating combined expressions that can produce data even if not
all elements have values. For single channels, this means that if the
channel is connected, but no value has been processed, a timeout
exception is still sent.
timeout
- the duration of the timeout; can't be nulltimeoutMessage
- the message for the reported timeoutpublic PVReaderConfiguration<T> readListener(PVReaderListener<? super T> listener)
Registering a listener here guarantees that no event is ever missed.
listener
- the listener to registerpublic PVReaderConfiguration<T> routeExceptionsTo(ExceptionHandler exceptionHandler)
Giving a custom exception handler will disable the default handler,
so PVReader.lastException()
is no longer set and no notification
is done.
exceptionHandler
- an exception handlerpublic PVReader<T> maxRate(org.epics.util.time.TimeDuration rate)
PVReader
object that can be monitored through listeners.rate
- the minimum time distance (i.e. the maximum rate) between two different notificationsCopyright © 2010–2015. All rights reserved.