|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.epics.pvmanager.PVManager
public class PVManager
Entry point for the library, manages the defaults and allows to create
PVReader
, PVWriter
and PV
from an read or write expression.
NotificationExecutor - This is used for all notifications.
By default this uses Executors.localThread()
so that
the notification are done on whatever current thread needs to notify.
This means that new read notifications are run on threads managed by
the ReadScannerExecutorService, write notifications are run on threads
managed by the DataSource and exceptions notification are run on the thread
where the exception is done. This can be changed to make all notifications
routed to single threaded sub-systems, such as UI environments like SWING,
SWT or similar. This can be changed on a PV by PV basis.
AsynchWriteExecutor - This is used for asynchronous writes, to return
right away, and for running timeouts on each write.
By default this uses the internal PVManager work pool. The work
submitted here is the calculation of the corresponding WriteExpression
and submission to the DataSource
. The DataSource itself typically
has asynchronous work, which is executed in the DataSource specific threads.
Changing this to Executors.localThread()
will make that preparation
task on the thread that calls PVWriter.write(java.lang.Object)
but
it will not transform the call in a synchronous call.
ReadScannerExecutorService - This is used to run the periodic
scan for new values. By default this uses the internal PVManager work pool. The work
submitted here is the calculation of the corresponding DesiredRateExpression
and submission to the NotificationExecutor.
Constructor Summary | |
---|---|
PVManager()
|
Method Summary | ||
---|---|---|
static java.util.concurrent.ScheduledExecutorService |
getAsyncWriteExecutor()
Returns the current executor on which the asynchronous calls are executed. |
|
static DataSource |
getDefaultDataSource()
Returns the current default data source. |
|
static java.util.concurrent.Executor |
getDefaultNotificationExecutor()
Returns the current default executor that will execute all notifications. |
|
static java.util.concurrent.ScheduledExecutorService |
getReadScannerExecutorService()
Returns the executor service used to schedule and run the periodic reading scan for new values. |
|
static
|
read(DesiredRateExpression<T> pvExpression)
Reads the given expression, and returns an object to configure the parameters for the read. |
|
static
|
read(SourceRateExpression<T> pvExpression)
Reads the given expression, and returns an object to configure the parameters for the read. |
|
static
|
readAndWrite(DesiredRateReadWriteExpression<R,W> readWriteExpression)
Both reads and writes the given expression, and returns an object to configure the parameters for the both read and write. |
|
static
|
readAndWrite(SourceRateReadWriteExpression<R,W> readWriteExpression)
Both reads and writes the given expression, and returns an object to configure the parameters for the both read and write. |
|
static void |
setAsyncWriteExecutor(java.util.concurrent.ScheduledExecutorService asyncWriteExecutor)
Changes the executor used for the asynchronous write calls. |
|
static void |
setDefaultDataSource(DataSource dataSource)
Changes the default source for data. |
|
static void |
setDefaultNotificationExecutor(java.util.concurrent.Executor notificationExecutor)
Changes the default executor on which all notifications are going to be posted. |
|
static void |
setReadScannerExecutorService(java.util.concurrent.ScheduledExecutorService readScannerExecutorService)
Changes the executor service to use for executing the periodic read scan. |
|
static
|
write(WriteExpression<T> writeExpression)
Writes the given expression, and returns an object to configure the parameters for the write. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PVManager()
Method Detail |
---|
public static void setDefaultNotificationExecutor(java.util.concurrent.Executor notificationExecutor)
notificationExecutor
- the new notification executorpublic static java.util.concurrent.Executor getDefaultNotificationExecutor()
public static void setDefaultDataSource(DataSource dataSource)
dataSource
- the data sourcepublic static DataSource getDefaultDataSource()
public static <T> PVReaderConfiguration<T> read(SourceRateExpression<T> pvExpression)
T
- type of the read payloadpvExpression
- the expression to read
public static <T> PVReaderConfiguration<T> read(DesiredRateExpression<T> pvExpression)
T
- type of the read payloadpvExpression
- the expression to read
public static <T> PVWriterConfiguration<T> write(WriteExpression<T> writeExpression)
T
- type of the write payloadwriteExpression
- the expression to write
public static <R,W> PVConfiguration<R,W> readAndWrite(SourceRateReadWriteExpression<R,W> readWriteExpression)
read(org.epics.pvmanager.expression.SourceRateExpression)
and write(org.epics.pvmanager.expression.WriteExpression)
at the same time.
R
- type of the read payloadW
- type of the write payloadreadWriteExpression
- the expression to read and write
public static <R,W> PVConfiguration<R,W> readAndWrite(DesiredRateReadWriteExpression<R,W> readWriteExpression)
read(org.epics.pvmanager.expression.SourceRateExpression)
and write(org.epics.pvmanager.expression.WriteExpression)
at the same time.
R
- type of the read payloadW
- type of the write payloadreadWriteExpression
- the expression to read and write
public static java.util.concurrent.ScheduledExecutorService getAsyncWriteExecutor()
public static void setAsyncWriteExecutor(java.util.concurrent.ScheduledExecutorService asyncWriteExecutor)
asyncWriteExecutor
- the new executorpublic static java.util.concurrent.ScheduledExecutorService getReadScannerExecutorService()
public static void setReadScannerExecutorService(java.util.concurrent.ScheduledExecutorService readScannerExecutorService)
readScannerExecutorService
- the new service for the read operations
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |