Class PVContext
- java.lang.Object
-
- org.epics.archiverappliance.engine.pv.PVContext
-
public class PVContext extends Object
Handle PV context, pool PVs by name. When using the pure java CA client implementation, it returns the same 'channel' when trying to access the same PV name multiple times. That's good, but I don't know how to determine if the channel for this EPICS_V3_PV is actually shared. Calling destroy() on such a shared channel creates problems.
The PVContext adds its own hash map of channels and keeps a reference count.- Version:
- 4-Jun-2012, Luofeng Li:added codes to support for the new archiver
- Author:
- Kay Kasemir s@version Initial version:CSS
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PVContext.MonitorMask
-
Constructor Summary
Constructors Constructor Description PVContext()
-
Method Summary
Modifier and Type Method Description static RefCountedChannel
getChannel(String name, int jcaCommandThreadId, gov.aps.jca.event.ConnectionListener conn_callback)
Get a new channel, or a reference to an existing one.static int
getChannelCount()
Return the channel count as this class sees it.static void
scheduleCommand(String pvName, int jcaCommandThreadId, RefCountedChannel channel_ref, String msg, Runnable command)
Add a command to the JCACommandThread.static void
setConfigservice(ConfigService configservice)
-
-
-
Method Detail
-
setConfigservice
public static void setConfigservice(ConfigService configservice)
-
getChannel
public static RefCountedChannel getChannel(String name, int jcaCommandThreadId, gov.aps.jca.event.ConnectionListener conn_callback) throws Exception
Get a new channel, or a reference to an existing one.- Parameters:
name
- Channel namejcaCommandThreadId
- The JCA Command thread.conn_callback
-- Returns:
- reference to channel
- Throws:
Exception
- on error- See Also:
releaseChannel(org.epics.archiverappliance.engine.pv.RefCountedChannel, gov.aps.jca.event.ConnectionListener)
-
scheduleCommand
public static void scheduleCommand(String pvName, int jcaCommandThreadId, RefCountedChannel channel_ref, String msg, Runnable command)
Add a command to the JCACommandThread.- Parameters:
pvName
- The name of the PV that this applies tojcaCommandThreadId
- The JCA Command thread for this PV.channel_ref
- this can be nullmsg
-command
- The runnable that will run in the specified command thread
-
getChannelCount
public static int getChannelCount()
Return the channel count as this class sees it.- Returns:
- int channels size
-
-