Class EPICSConnector

java.lang.Object
org.scictrl.csshell.AbstractConnector<EPICSConnection<?>>
org.scictrl.csshell.epics.EPICSConnector
All Implemented Interfaces:
gov.aps.jca.event.ContextExceptionListener, gov.aps.jca.event.ContextMessageListener, EventListener

public class EPICSConnector extends AbstractConnector<EPICSConnection<?>> implements gov.aps.jca.event.ContextExceptionListener, gov.aps.jca.event.ContextMessageListener
Implementation of EPICS plugin.
Author:
igor@scictrl.com
  • Field Details

    • TYPE

      public static final String TYPE
      Plug type string.
      See Also:
    • DEFAULT_AUTHORITY

      public static final String DEFAULT_AUTHORITY
      Default authority.
      See Also:
    • PROPERTY_USE_JNI

      public static final String PROPERTY_USE_JNI
      Property name for JCA context type flag. If false or not defined then by default CAJ instance of JCA context is used. If value set to true in System properties or in configuration properties, then JNI (thread safe) instance of JCA context is used. Property defined in System properties take precedence before property in defined in configuration.
      See Also:
    • PARAMETER_MONITOR_MASK

      public static final String PARAMETER_MONITOR_MASK
      Parameter name for expert monitor creation. Value is of type Integer and provides mask value for EPICS monitor creation.
      See Also:
    • PROPERTY_VERBOSITY

      public static final String PROPERTY_VERBOSITY
      Property name for verbosity of INFO log level. Verbosity 0 is minimal, verbosity 1 reports individual connections are made. Default is 1.
      See Also:
    • PROPERTY_DEFAULT_PENDIO_TIMEOUT

      public static final String PROPERTY_DEFAULT_PENDIO_TIMEOUT
      Property name for default pendIO timeout property. Value is of type Double and provides the default timeout for pendIO.
      See Also:
    • PROPERTY_DEFAULT_MONITOR_MASK

      public static final String PROPERTY_DEFAULT_MONITOR_MASK
      Property name for default monitor property. Value is of type Integer and provides mask value for default EPICS monitor creation.
      See Also:
    • PROPERTY_JNI_FLUSH_TIMER_DELAY

      public static final String PROPERTY_JNI_FLUSH_TIMER_DELAY
      Property name for JNI flush timer delay. The default value is 100 ms and it is overridden if provided in the configuration. Property defined in System properties take precedence before property in defined in configuration.
      See Also:
    • DEFAULT_VERBOSITY

      public static final int DEFAULT_VERBOSITY
      Default verbosity level.
      See Also:
    • PROPERTY_JCA_ADDR_LIST

      public static final String PROPERTY_JCA_ADDR_LIST
      Constant PROPERTY_JCA_ADDR_LIST="addr_list"
      See Also:
    • PROPERTY_JCA_AUTO_ADDR_LIST

      public static final String PROPERTY_JCA_AUTO_ADDR_LIST
      Constant PROPERTY_JCA_AUTO_ADDR_LIST="auto_addr_list"
      See Also:
    • PROPERTY_JCA_NAME_SERVERS

      public static final String PROPERTY_JCA_NAME_SERVERS
      Constant PROPERTY_JCA_NAME_SERVERS="name_servers"
      See Also:
    • PROPERTY_JCA_CONNECTION_TIMEOUT

      public static final String PROPERTY_JCA_CONNECTION_TIMEOUT
      Constant PROPERTY_JCA_CONNECTION_TIMEOUT="connection_timeout"
      See Also:
    • PROPERTY_JCA_BEACON_PERIOD

      public static final String PROPERTY_JCA_BEACON_PERIOD
      Constant PROPERTY_JCA_BEACON_PERIOD="beacon_period"
      See Also:
    • PROPERTY_JCA_REPEATER_PORT

      public static final String PROPERTY_JCA_REPEATER_PORT
      Constant PROPERTY_JCA_REPEATER_PORT="repeater_port"
      See Also:
    • PROPERTY_JCA_SERVER_PORT

      public static final String PROPERTY_JCA_SERVER_PORT
      Constant PROPERTY_JCA_SERVER_PORT="server_port"
      See Also:
    • PROPERTY_JCA_MAX_ARRAY_BYTES

      public static final String PROPERTY_JCA_MAX_ARRAY_BYTES
      Constant PROPERTY_JCA_MAX_ARRAY_BYTES="max_array_bytes"
      See Also:
  • Method Details

    • newInstance

      public static EPICSConnector newInstance(Properties configuration) throws RemoteException
      Create new EPICS plug instance.
      Parameters:
      configuration - a Properties object
      Returns:
      a EPICSConnector object
      Throws:
      RemoteException - if initialization of remote context fails
    • getInstance

      public static AbstractConnector<?> getInstance(Properties configuration) throws RemoteException
      Create new EPICS plug instance.
      Parameters:
      configuration - a Properties object
      Returns:
      a EPICSConnector object
      Throws:
      RemoteException - if initialization of remote context fails
    • shutdown

      public void shutdown() throws Exception

      shutdown.

      Overrides:
      shutdown in class AbstractConnector<EPICSConnection<?>>
      Throws:
      Exception - if any.
    • getVerbosity

      public int getVerbosity()

      Getter for the field verbosity.

      Returns:
      a int
    • getType

      public String getType()

      getType.

      Specified by:
      getType in class AbstractConnector<EPICSConnection<?>>
      Returns:
      a String object
    • flushIO

      public void flushIO()

      flushIO.

    • pendIO

      public void pendIO() throws gov.aps.jca.CAException, gov.aps.jca.TimeoutException, RemoteException

      pendIO.

      Throws:
      gov.aps.jca.CAException - if any.
      gov.aps.jca.TimeoutException - if any.
      RemoteException - if any.
    • getContext

      public gov.aps.jca.Context getContext()

      Getter for the field context.

      Returns:
      a Context object
    • getTimeout

      public long getTimeout()
      Get timeout parameter (in milliseconds). It is configured trough system property defined by org.epics.css.dal.spi.Plugs.CONNECTION_TIMEOUT.
      Returns:
      timeout (in milliseconds)
    • getDefaultMonitorMask

      public int getDefaultMonitorMask()
      Gets the default monitor mask.
      Returns:
      the default monitor mask
    • isInitializeCharacteristicsOnConnect

      public boolean isInitializeCharacteristicsOnConnect()
      Gets the initializeCharacteristicsOnConnect property.
      Returns:
      true if characteristics should be initialized on connect and false otherwise.
    • isDbrUpdatesCharacteristics

      public boolean isDbrUpdatesCharacteristics()

      isDbrUpdatesCharacteristics.

      Returns:
      a boolean
    • isUseCommonExecutor

      public boolean isUseCommonExecutor()
      Gets useCommonExecutor property.
      Returns:
      true if common executor should be used and false otherwise.
    • contextException

      public void contextException(gov.aps.jca.event.ContextExceptionEvent ev)
      Specified by:
      contextException in interface gov.aps.jca.event.ContextExceptionListener
    • contextVirtualCircuitException

      public void contextVirtualCircuitException(gov.aps.jca.event.ContextVirtualCircuitExceptionEvent ev)
      Specified by:
      contextVirtualCircuitException in interface gov.aps.jca.event.ContextExceptionListener
    • contextMessage

      public void contextMessage(gov.aps.jca.event.ContextMessageEvent ev)
      Specified by:
      contextMessage in interface gov.aps.jca.event.ContextMessageListener
    • getMetaData

      public MetaData getMetaData(String name, DataType type) throws Exception

      getMetaData.

      Specified by:
      getMetaData in class AbstractConnector<EPICSConnection<?>>
      Parameters:
      name - a String object
      type - a DataType object
      Returns:
      a MetaData object
      Throws:
      Exception - if any.
    • getMetaDataAsync

      public void getMetaDataAsync(String name, DataType type, PropertyChangeListener l) throws Exception

      getMetaDataAsync.

      Parameters:
      name - a String object
      type - a DataType object
      l - a PropertyChangeListener object
      Throws:
      Exception - if any.
    • getMetaDataAsync

      public void getMetaDataAsync(gov.aps.jca.Channel channel, PropertyChangeListener l) throws Exception

      getMetaDataAsync.

      Specified by:
      getMetaDataAsync in class AbstractConnector<EPICSConnection<?>>
      Parameters:
      channel - a Channel object
      l - a PropertyChangeListener object
      Throws:
      Exception - if any.
    • getOneShot

      public gov.aps.jca.dbr.DBR getOneShot(String name, gov.aps.jca.dbr.DBRType type) throws Exception

      getOneShot.

      Parameters:
      name - a String object
      type - a DBRType object
      Returns:
      a DBR object
      Throws:
      Exception - if any.
    • getOneShot

      public Poop<?,gov.aps.jca.dbr.DBR> getOneShot(String name) throws Exception
      Makes one time get request and tries to get as many data as possible. Data type is taken from channel.
      Parameters:
      name - PV name
      Returns:
      the Poop object with everything
      Throws:
      Exception - if any
    • getValue

      public Object getValue(String name, DataType type) throws RemoteException

      getValue.

      Specified by:
      getValue in class AbstractConnector<EPICSConnection<?>>
      Parameters:
      name - a String object
      type - a DataType object
      Returns:
      a Object object
      Throws:
      RemoteException - if any.
    • newConnection

      public EPICSConnection<?> newConnection(String name, DataType dataType) throws RemoteException

      newConnection.

      Specified by:
      newConnection in class AbstractConnector<EPICSConnection<?>>
      Parameters:
      name - a String object
      dataType - a DataType object
      Returns:
      a C object
      Throws:
      RemoteException - if any.