Class 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
    • Constructor Detail

      • PVContext

        public PVContext()
    • 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 name
        jcaCommandThreadId - 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 to
        jcaCommandThreadId - The JCA Command thread for this PV.
        channel_ref - this can be null
        msg -  
        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