public class CachedPVProvider extends Object implements Serializable
CachedPVProvider is a singleton that provides PVs by PV name. PVs retrieved through
CachedPVProvider are cached and the connection is kept open, so that there is no need to reconnect them
on subsequent uses.
CachedPVProvider also offers capability of automatically connecting and caching PVs on startup. PVs that
should take advantage of this must be declared in "autoconnect.xml" file, which must in turn be located
somewhere in the classpath.| Modifier and Type | Field and Description |
|---|---|
static String |
FILE_AUTOCONNECT
The name of the file that defines the PVs that RBAC automatically connects to at startup
|
| Constructor and Description |
|---|
CachedPVProvider() |
| Modifier and Type | Method and Description |
|---|---|
PV |
getPV(String pvName)
Returns a PV connection by the specified name from cache or creates a new one, if on does not already exist.
|
PV |
getPV(String pvName,
boolean waitForValue)
Returns a PV connection by the specified name from cache or creates a new one, if on does not already exist.
|
public static final String FILE_AUTOCONNECT
public PV getPV(String pvName, boolean waitForValue) throws PVException
pvName - name of the PVwaitForValue - if true the calling thread will be blocked, until the PV receives the first value, but no
longer than 2 secondsPVException - if there is a problem connecting the PV or if the parameter is nullPV.blockUntilFirstUpdate(int)public PV getPV(String pvName) throws PVException
pvName - name of the PVPVException - if there is a problem connecting the PV or parameter is nullCopyright © 2023 European Spallation Source. All rights reserved.