Package xal.ca

Class ChannelFactory

java.lang.Object
xal.ca.ChannelFactory
Direct Known Subclasses:
Epics7ChannelFactory, Epics7ServerChannelFactory

public abstract class ChannelFactory extends Object
ChannelFactory is a factory for generating channels.
Author:
tap
  • Field Details

    • testSuffix

      protected String testSuffix
  • Constructor Details

    • ChannelFactory

      protected ChannelFactory()
      Creates a new instance of ChannelFactory
  • Method Details

    • init

      public abstract boolean init()
      Initialize the channel system
      Returns:
      true if the initialization was successful and false if not
    • dispose

      protected abstract void dispose()
    • destroy

      public void destroy()
    • disposeAll

      public static void disposeAll()
      Dispose all channel systems
    • getChannel

      public Channel getChannel(String signalName)
      Get a channel associated with the signal name. If the channel is already in our map, then return it, otherwise create a new one and add it to our channel map.
      Parameters:
      signalName - The PV signal name of the channel
      Returns:
      The channel corresponding to the signal name
    • getChannel

      public Channel getChannel(String signalName, ValueTransform transform)
      Get a channel associated with the signal name and transform. If the channel is already in our map, then return it, otherwise create a new one and add it to our channel map.
      Parameters:
      signalName - The PV signal name of the channel
      transform - The channel's value transform
      Returns:
      The channel corresponding to the signal name
    • newChannel

      protected abstract Channel newChannel(String signalName)
      Create a concrete channel which makes an appropriate low level channel
      Parameters:
      signalName - PV for which to create a new channel
      Returns:
      a new channel for the specified signal name
    • newChannel

      protected Channel newChannel(String signalName, ValueTransform transform)
      Create a new channel for the given signal name and set its value transform.
      Parameters:
      signalName - The PV signal name
      transform - The value transform to use in the channel
      Returns:
      The new channel
    • defaultFactory

      public static ChannelFactory defaultFactory()
      Get the default factory which determines the low level channel implementation
      Returns:
      The default channel factory
    • channelSystem

      protected abstract ChannelSystem channelSystem()
      Get the associated channel system from the channel factory implementation.
      Returns:
      The channel system
    • newFactory

      protected static ChannelFactory newFactory()
      Instantiate a new ChannelFactory
      Returns:
      a new channel factory
    • newServerFactory

      public static ChannelFactory newServerFactory()
      Instantiate a new server ChannelFactory
      Returns:
      a new server channel factory
    • printInfo

      public abstract void printInfo()
      Print information about this factory
    • setTest

      public void setTest(boolean test)
      Sets the test flag. If the test flag is on, the factory will add a suffix to the signal names to distinguish from the original signals. This is a useful feature to test applications, which can run a server with the test flag and the client will connect to the test channels.
      Parameters:
      test -
    • isTest

      public boolean isTest()
    • setTestSuffix

      public void setTestSuffix(String suffix)
      This method allows to define a suffix for all PVs when the test mode is enabled. By default, the suffix is ":TEST".
      Parameters:
      suffix -
    • getTestSuffix

      public String getTestSuffix()