org.epics.pvmanager
Class PVConfiguration<R,W>

java.lang.Object
  extended by org.epics.pvmanager.PVConfiguration<R,W>
Type Parameters:
R - the read payload
W - the write payload

public class PVConfiguration<R,W>
extends java.lang.Object

Allows to configure the type of read/write PV to create.

Author:
carcassi

Method Summary
 PV<R,W> asynchWriteAndMaxReadRate(TimeDuration period)
          Creates the pv such that writes are asynchronous and read notifications comes at most at the rate specified.
 PV<R,W> asynchWriteAndReadEvery(TimeDuration period)
          Deprecated. 
 PVConfiguration<R,W> from(DataSource dataSource)
          Defines which DataSource should be used to read the data.
 PVConfiguration<R,W> notifyOn(java.util.concurrent.Executor onThread)
          Defines on which thread the PVManager should notify the client.
 PVConfiguration<R,W> routeExceptionsTo(ExceptionHandler exceptionHandler)
          Forwards exception to the given exception handler.
 PV<R,W> synchWriteAndMaxReadRate(TimeDuration period)
          Creates the pv such that writes are synchronous and read notifications comes at most at the rate specified.
 PV<R,W> synchWriteAndReadEvery(TimeDuration period)
          Deprecated. 
 PVConfiguration<R,W> timeout(TimeDuration timeout)
           
 PVConfiguration<R,W> timeout(TimeDuration timeout, java.lang.String timeoutMessage)
           
 PVConfiguration<R,W> timeout(TimeDuration timeout, java.lang.String readMessage, java.lang.String writeMessage)
          Specifies a timeout, with a different message for the read and the write.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

from

public PVConfiguration<R,W> from(DataSource dataSource)
Defines which DataSource should be used to read the data.

Parameters:
dataSource - a connection manager
Returns:
this

notifyOn

public PVConfiguration<R,W> notifyOn(java.util.concurrent.Executor onThread)
Defines on which thread the PVManager should notify the client.

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

timeout

public PVConfiguration<R,W> timeout(TimeDuration timeout)

timeout

public PVConfiguration<R,W> timeout(TimeDuration timeout,
                                    java.lang.String timeoutMessage)

timeout

public PVConfiguration<R,W> timeout(TimeDuration timeout,
                                    java.lang.String readMessage,
                                    java.lang.String writeMessage)
Specifies a timeout, with a different message for the read and the write.

Parameters:
timeout - time before notification
readMessage - exception message for the read timeout
writeMessage - exception message for the write timeout
Returns:
this

routeExceptionsTo

public PVConfiguration<R,W> 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 PV.lastException() and PV.lastWriteException() is no longer set and no notification is done.

Parameters:
exceptionHandler - an exception handler
Returns:
this

synchWriteAndMaxReadRate

public PV<R,W> synchWriteAndMaxReadRate(TimeDuration period)
Creates the pv such that writes are synchronous and read notifications comes at most at the rate specified.

Parameters:
period - minimum time between read notifications
Returns:
a new PV

asynchWriteAndMaxReadRate

public PV<R,W> asynchWriteAndMaxReadRate(TimeDuration period)
Creates the pv such that writes are asynchronous and read notifications comes at most at the rate specified.

Parameters:
period - minimum time between read notifications
Returns:
a new PV

synchWriteAndReadEvery

@Deprecated
public PV<R,W> synchWriteAndReadEvery(TimeDuration period)
Deprecated. 

Creates the pv such that writes are synchronous and read notifications comes at most at the rate specified.

Parameters:
period - minimum time between read notifications
Returns:
a new PV

asynchWriteAndReadEvery

@Deprecated
public PV<R,W> asynchWriteAndReadEvery(TimeDuration period)
Deprecated. 

Creates the pv such that writes are asynchronous and read notifications comes at most at the rate specified.

Parameters:
period - minimum time between read notifications
Returns:
a new PV