org.epics.pvmanager
Class PVWriterConfiguration<T>

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

public class PVWriterConfiguration<T>
extends java.lang.Object

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

Author:
carcassi

Method Summary
 PVWriter<T> async()
          Creates a new PVWriter where the PVWriter.write(java.lang.Object) method is asynchronous (i.e.
 PVWriterConfiguration<T> from(DataSource dataSource)
          Defines which DataSource should be used to read the data.
 PVWriterConfiguration<T> notifyOn(java.util.concurrent.Executor onThread)
          Defines on which thread the PVManager should notify the client.
 PVWriterConfiguration<T> routeExceptionsTo(ExceptionHandler exceptionHandler)
          Forwards exception to the given exception handler.
 PVWriter<T> sync()
          Creates a new PVWriter where the PVWriter.write(java.lang.Object) method is synchronous (i.e.
 PVWriterConfiguration<T> timeout(TimeDuration timeout)
           
 PVWriterConfiguration<T> timeout(TimeDuration timeout, java.lang.String timeoutMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

from

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

Parameters:
dataSource - a connection manager
Returns:
this

notifyOn

public PVWriterConfiguration<T> 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 PVWriterConfiguration<T> timeout(TimeDuration timeout)

timeout

public PVWriterConfiguration<T> timeout(TimeDuration timeout,
                                        java.lang.String timeoutMessage)

routeExceptionsTo

public PVWriterConfiguration<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 PVWriter.lastWriteException() is no longer set and no notification is done.

Parameters:
exceptionHandler - an exception handler
Returns:
this

sync

public PVWriter<T> sync()
Creates a new PVWriter where the PVWriter.write(java.lang.Object) method is synchronous (i.e. blocking).

Returns:
a new PVWriter

async

public PVWriter<T> async()
Creates a new PVWriter where the PVWriter.write(java.lang.Object) method is asynchronous (i.e. non-blocking).

Returns:
a new PVWriter