Package org.phoebus.pv
Class PVPool
- java.lang.Object
-
- org.phoebus.pv.PVPool
-
public class PVPool extends Object
Pool ofPV
sAllows creating PVs for all known PVFactory services.
Maintains PVs, with a reference count.
A PV is referred to by different names:
- The name provided by the user: "fred" or "ca://fred", with or without prefix. May also contain parameters: "loc://x(3.14)" or "loc://x(14)".
- Name used by the type-dependent implementation: "fred"
The PV and the pool use the name provided by the user, because that way
PV.getName()
will always return the expected name. On the downside, this could create the same underlying PV twice, with and without the prefix.Note also that "loc://x(3.14)" and "loc://x(14)" will be treated as different PVs.
- Author:
- Kay Kasemir
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PVPool.TypedName
Combination of type and name,type://name
-
Field Summary
Fields Modifier and Type Field Description static String
default_type
Default PV name type prefixstatic String
SEPARATOR
Separator between PV type indicator and rest of PV name.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<String>
getNameVariants(String name, String[] equivalent_pv_prefixes)
static PV
getPV(String name)
Obtain a PVstatic Collection<RefCountMap.ReferencedEntry<PV>>
getPVReferences()
static Collection<String>
getSupportedPrefixes()
static void
releasePV(PV pv)
-
-
-
Field Detail
-
SEPARATOR
public static final String SEPARATOR
Separator between PV type indicator and rest of PV name.This one is URL-like, and works OK with EPICS PVs because those are unlikely to contain "://" themselves, while just ":" for example is likely to be inside the PV name
- See Also:
- Constant Field Values
-
default_type
public static String default_type
Default PV name type prefix
-
-
Method Detail
-
getNameVariants
public static Set<String> getNameVariants(String name, String[] equivalent_pv_prefixes)
- Parameters:
name
- PV Name, may be "xxx" or "type://xxx"equivalent_pv_prefixes
- List of equivalent PV prefixes (types), e.g. "ca", "pva"- Returns:
- Set of equivalent names, e.g. "xxx", "ca://xxx", "pva://xxx"
-
getSupportedPrefixes
public static Collection<String> getSupportedPrefixes()
- Returns:
- Supported PV type prefixes
-
getPV
public static PV getPV(String name) throws Exception
Obtain a PVObtains existing PV of that name from pool, or creates new PV if no existing PV found.
- Parameters:
name
- PV name, where prefix might be used to determine the type- Returns:
PV
- Throws:
Exception
- on error- See Also:
releasePV(PV)
-
releasePV
public static void releasePV(PV pv)
- Parameters:
pv
- PV to be released
-
getPVReferences
public static Collection<RefCountMap.ReferencedEntry<PV>> getPVReferences()
- Returns:
- PVs currently in the pool with reference count information
-
-