Class EpicsChannelValueGetter

java.lang.Object
ch.psi.wica.controlsystem.epics.channel.EpicsChannelValueGetter

@Immutable @Component public class EpicsChannelValueGetter extends Object
Provides the functionality to build and return a WicaChannelValue object using information obtained by querying a connected EPICS channel.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Returns a new instance that will work with the specified value builder object.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(org.epics.ca.Channel<Object> channel, long timeout, TimeUnit timeUnit)
    Performs a channel-access GET operation on the supplied EPICS channel and returns a WicaChannelValue object which encapsulates the properties of the channel which may change quickly (eg online/offline state, instantaneous value, timestamp, alarm severity etc).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EpicsChannelValueGetter

      public EpicsChannelValueGetter(@Autowired WicaChannelValueCreator wicaChannelValueCreator)
      Returns a new instance that will work with the specified value builder object.
      Parameters:
      wicaChannelValueCreator - the builder.
  • Method Details

    • get

      public WicaChannelValue get(org.epics.ca.Channel<Object> channel, long timeout, TimeUnit timeUnit) throws InterruptedException, TimeoutException, ExecutionException
      Performs a channel-access GET operation on the supplied EPICS channel and returns a WicaChannelValue object which encapsulates the properties of the channel which may change quickly (eg online/offline state, instantaneous value, timestamp, alarm severity etc).

      This method operates synchronously and potentially incurs the cost of a network round trip to obtain the information from the remote data source.

      If the channel is already offline when this method is invoked then the returned value will be returned immediately to indicate that the channel is disconnected. However, if the channel goes offline just at the moment it is queried then in the worst case this method will incur the cost of the channel-access GET operation timeout, which may be several seconds.

      Precondition: the channel should have been connected at least once. Postcondition: the state of the channel will remain unaffected.

      Parameters:
      channel - the EPICS channel to query.
      timeout - the timeout to be applied when attempting to get the channel value from the underlying data source. If a timeout occurs the returned value will be WicaChannelMetadataUnknown.
      timeUnit - the time units to be used.
      Returns:
      the object created as a result of the channel access GET
      Throws:
      NullPointerException - if the channel argument was null.
      IllegalStateException - if the channel state was not as expected.
      InterruptedException - if the channel get operation was interrupted.
      TimeoutException - if the channel get operation timed out.
      ExecutionException - if the channel get operation through failed