Class Epics7ServerChannel

java.lang.Object
xal.ca.Channel
xal.plugin.epics7.Epics7Channel
xal.plugin.epics7.server.Epics7ServerChannel
All Implemented Interfaces:
org.epics.pvaccess.client.ChannelRequester, org.epics.pvdata.pv.Requester, IServerChannel

public class Epics7ServerChannel extends Epics7Channel implements IServerChannel
Server channel implementation. It creates PVAccess and CA channels, independently of the signal prefix. This is done to ensure backwards compatibility. Gets are done on the PVRecord, while sets are done to both PVRecord and CA PV, so that they are always in sync.
Author:
Juan F. Esteban Müller <JuanF.EstebanMuller@ess.eu>
  • Constructor Details

  • Method Details

    • connectAndWait

      public boolean connectAndWait(double timeout)
      Description copied from class: Channel
      Request a new connection and wait for it no longer than the timeout.
      Overrides:
      connectAndWait in class Epics7Channel
      Parameters:
      timeout - seconds to wait for a connection before giving up
      Returns:
      true if the connection was made within the timeout and false if not
    • requestConnection

      public final void requestConnection()
      Description copied from class: Channel
      Request that the channel be connected. Connections are made in the background so this method returns immediately upon making the request. The connection will be made in the future as soon as possible. A connection event will be sent to registered connection listeners when the connection has been established.
      Overrides:
      requestConnection in class Epics7Channel
    • disconnect

      public void disconnect()
      Description copied from class: Channel
      Terminate the network channel connection and clear all events associated with process variable
      Overrides:
      disconnect in class Epics7Channel
    • getCaLock

      public ReentrantLock getCaLock()
    • getPvaLock

      public ReentrantLock getPvaLock()
    • elementCount

      public int elementCount() throws ConnectionException
      Description copied from class: Channel
      Return size of value array associated with process variable
      Overrides:
      elementCount in class Epics7Channel
      Returns:
      number of values in process variable
      Throws:
      ConnectionException - accordingly
    • getDisplay

      protected org.epics.pvdata.pv.PVStructure getDisplay()
      Overrides:
      getDisplay in class Epics7Channel
    • getVAlueAlarm

      protected org.epics.pvdata.pv.PVStructure getVAlueAlarm()
      Overrides:
      getVAlueAlarm in class Epics7Channel
    • getControl

      protected org.epics.pvdata.pv.PVStructure getControl()
      Overrides:
      getControl in class Epics7Channel
    • getUnits

      public String getUnits()
      Description copied from class: Channel
      Convenience method which returns the units for this channel.
      Specified by:
      getUnits in interface IServerChannel
      Overrides:
      getUnits in class Epics7Channel
      Returns:
      the units
    • getRawValueRecord

      public ChannelRecord getRawValueRecord() throws GetException
      Description copied from class: Channel
      Return a raw ChannelRecord representing the fetched record for the native type of this channel. This is a convenient way to get the value of the PV.
      Overrides:
      getRawValueRecord in class Epics7Channel
      Returns:
      raw channel record
      Throws:
      GetException - accordingly
    • getRawStatusRecord

      public ChannelStatusRecord getRawStatusRecord() throws GetException
      Description copied from class: Channel
      Return a raw ChannelStatusRecord representing the fetched record for the native type of this channel. This is a convenient way to get the value of the PV along with status.
      Overrides:
      getRawStatusRecord in class Epics7Channel
      Returns:
      raw channel record
      Throws:
      GetException - accordingly
    • getRawTimeRecord

      public ChannelTimeRecord getRawTimeRecord() throws GetException
      Description copied from class: Channel
      Return a raw ChannelTimeRecord representing the fetched record for the native type of this channel. This is a convenient way to get the value of the PV along with status and timestamp.
      Overrides:
      getRawTimeRecord in class Epics7Channel
      Returns:
      raw channel record
      Throws:
      GetException - accordingly
    • getRawValueCallback

      protected void getRawValueCallback(IEventSinkValue listener) throws GetException
      Description copied from class: Channel
      Handle a callback for getting the raw value for the channel.
      Overrides:
      getRawValueCallback in class Epics7Channel
      Parameters:
      listener - The receiver of the callback.
      Throws:
      GetException - accordingly
    • getRawValueCallback

      protected void getRawValueCallback(IEventSinkValue listener, boolean attemptConnection) throws GetException
      Description copied from class: Channel
      Handle a callback for getting the raw value for the channel.
      Overrides:
      getRawValueCallback in class Epics7Channel
      Parameters:
      listener - The receiver of the callback.
      attemptConnection - indicates whether or not to attempt a blocking connection if this channel is not connected
      Throws:
      GetException - accordingly
    • getRawValueTimeCallback

      public void getRawValueTimeCallback(IEventSinkValTime listener, boolean attemptConnection) throws GetException
      Description copied from class: Channel
      Submit a non-blocking Get request with callback
      Overrides:
      getRawValueTimeCallback in class Epics7Channel
      Parameters:
      listener - to receive callback upon completion
      attemptConnection - true to attempt connection and false not to attempt connection
      Throws:
      GetException - accordingly
    • addMonitorValTime

      public Monitor addMonitorValTime(IEventSinkValTime listener, int intMaskFire) throws MonitorException
      Description copied from class: Channel
      Setup a value-status-timestamp monitor on this channel
      Overrides:
      addMonitorValTime in class Epics7Channel
      Parameters:
      listener - interface to data sink
      intMaskFire - code specifying when the monitor is fired or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM}
      Returns:
      A new monitor
      Throws:
      MonitorException - general monitor failure
    • addMonitorValStatus

      public Monitor addMonitorValStatus(IEventSinkValStatus listener, int intMaskFire) throws MonitorException
      Description copied from class: Channel
      Setup a value-status monitor on this channel
      Overrides:
      addMonitorValStatus in class Epics7Channel
      Parameters:
      listener - interface to data sink
      intMaskFire - code specifying when the monitor is fired or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM}
      Returns:
      A new monitor
      Throws:
      MonitorException - general monitor failure
    • addMonitorValue

      public Monitor addMonitorValue(IEventSinkValue listener, int intMaskFire) throws MonitorException
      Description copied from class: Channel
      Setup a value monitor on this channel
      Overrides:
      addMonitorValue in class Epics7Channel
      Parameters:
      listener - interface to data sink
      intMaskFire - code specifying when the monitor is fired or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM}
      Returns:
      A new monitor
      Throws:
      MonitorException - general monitor failure
    • putRawValCallback

      public void putRawValCallback(String newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(byte newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(short newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(int newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(long newVal, PutListener listener) throws PutException
      Long is not supported in EPICS3, so they are cast to int for CA.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(float newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(double newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(String[] newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(byte[] newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(short[] newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(int[] newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(long[] newVal, PutListener listener) throws PutException
      Long is not supported in EPICS3, so they are cast to int for CA.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(float[] newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • putRawValCallback

      public void putRawValCallback(double[] newVal, PutListener listener) throws PutException
      Description copied from class: Channel
      Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.
      Overrides:
      putRawValCallback in class Epics7Channel
      Parameters:
      newVal - value sent to process variable
      listener - The receiver of the callback event
      Throws:
      PutException - general put failure
    • setUnits

      public void setUnits(String units)
      Description copied from interface: IServerChannel
      Set the units
      Specified by:
      setUnits in interface IServerChannel
      Parameters:
      units - to apply
    • setLowerDispLimit

      public void setLowerDispLimit(Number lowerLimit)
      Description copied from interface: IServerChannel
      Set the lower display limit
      Specified by:
      setLowerDispLimit in interface IServerChannel
      Parameters:
      lowerLimit - to apply
    • setUpperDispLimit

      public void setUpperDispLimit(Number upperLimit)
      Description copied from interface: IServerChannel
      Set the upper display limit
      Specified by:
      setUpperDispLimit in interface IServerChannel
      Parameters:
      upperLimit - to apply
    • setLowerAlarmLimit

      public void setLowerAlarmLimit(Number lowerLimit)
      Description copied from interface: IServerChannel
      Set the lower alarm limit
      Specified by:
      setLowerAlarmLimit in interface IServerChannel
      Parameters:
      lowerLimit - to apply
    • setUpperAlarmLimit

      public void setUpperAlarmLimit(Number upperLimit)
      Description copied from interface: IServerChannel
      Set the upper alarm limit
      Specified by:
      setUpperAlarmLimit in interface IServerChannel
      Parameters:
      upperLimit - to apply
    • setLowerWarningLimit

      public void setLowerWarningLimit(Number lowerLimit)
      Description copied from interface: IServerChannel
      Set the lower warning limit
      Specified by:
      setLowerWarningLimit in interface IServerChannel
      Parameters:
      lowerLimit - to apply
    • setUpperWarningLimit

      public void setUpperWarningLimit(Number upperLimit)
      Description copied from interface: IServerChannel
      Set the upper warning limit
      Specified by:
      setUpperWarningLimit in interface IServerChannel
      Parameters:
      upperLimit - to apply
    • setLowerCtrlLimit

      public void setLowerCtrlLimit(Number lowerLimit)
      Description copied from interface: IServerChannel
      Set the lower control limit
      Specified by:
      setLowerCtrlLimit in interface IServerChannel
      Parameters:
      lowerLimit - to apply
    • setUpperCtrlLimit

      public void setUpperCtrlLimit(Number upperLimit)
      Description copied from interface: IServerChannel
      Set the upper control limit
      Specified by:
      setUpperCtrlLimit in interface IServerChannel
      Parameters:
      upperLimit - to apply
    • setSettable

      public void setSettable(boolean settable)
      Description copied from interface: IServerChannel
      Set whether the value of this channel can be changed by the clients.
      Specified by:
      setSettable in interface IServerChannel
      Parameters:
      settable - true if it can be changed