Class EmbeddedApplicationServer

java.lang.Object
org.scictrl.csshell.epics.server.application.AbstractApplication
org.scictrl.csshell.epics.server.application.EmbeddedApplicationServer
All Implemented Interfaces:
Application, OnDemandValueProcessor.ValueProvider

public class EmbeddedApplicationServer extends AbstractApplication

EmbeddedApplicationServer class.

Author:
igor@scictrl.com
  • Method Details

    • newInstance

      public static final EmbeddedApplicationServer newInstance(String name)

      newInstance.

      Parameters:
      name - a String object
      Returns:
      a EmbeddedApplicationServer object
    • startServer

      public void startServer() throws org.apache.commons.configuration.ConfigurationException, RemoteException, gov.aps.jca.CAException
      Collects all created records from this application and starts new server with them.
      Throws:
      org.apache.commons.configuration.ConfigurationException - server error
      RemoteException - server error
      gov.aps.jca.CAException - server error
    • startServer

      public void startServer(Properties properties) throws org.apache.commons.configuration.ConfigurationException, RemoteException, gov.aps.jca.CAException
      Collects all created records from this application and starts new server wth them.
      Parameters:
      properties - a Properties object
      Throws:
      org.apache.commons.configuration.ConfigurationException - server error
      RemoteException - server error
      gov.aps.jca.CAException - server error
    • getServer

      public Server getServer()
      The server instance which hosts this application. It is available only after startServer() has been called.
      Returns:
      server instance which hosts this application
    • getDatabase

      public Database getDatabase()
      Returns Database instance which holds this applications's active records.
      Returns:
      Database instance which holds this applications's active records
    • addRecordChangeListener

      public void addRecordChangeListener(PropertyChangeListener l)

      addRecordChangeListener.

      Parameters:
      l - a PropertyChangeListener object
    • addRecordWriteListener

      public void addRecordWriteListener(PropertyChangeListener l)

      addRecordWriteListener.

      Parameters:
      l - a PropertyChangeListener object
    • notifyRecordChange

      protected void notifyRecordChange(String name, boolean alarmOnly)
      This method is called whenever record value changed for any record, which belongs to this application (it was added to the application AbstractApplication.addRecord(String, Record)). Implementation class should override this method to intercept the update.
      Overrides:
      notifyRecordChange in class AbstractApplication
      Parameters:
      name - the name of record, that triggered change.
      alarmOnly - if true then only alarm has been changed
    • notifyRecordWrite

      protected void notifyRecordWrite(String name)
      This method is called whenever record value has been written for any record, which belongs to this application (it was added to the application AbstractApplication.addRecord(String, Record)). Implementation class should override this method to intercept the update.
      Overrides:
      notifyRecordWrite in class AbstractApplication
      Parameters:
      name - the name of record, that triggered change.
    • createRecord

      public Record createRecord(String name, String desc, Double min, Double max, String units, short precision, Double value)
      Creates new application record with double data type.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      min - the record field value for minimum
      max - the record field value for maximum
      units - the record field value for units
      precision - the record field value for precision
      value - the record initial value
      Returns:
      newly created record
    • createRecord

      public Record createRecord(String name, String desc, Integer min, Integer max, String units, Integer value)
      Creates new application record with double data type.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      min - the record field value for minimum
      max - the record field value for maximum
      units - the record field value for units
      value - the record initial value
      Returns:
      newly created record
    • createRecord

      public Record createRecord(String name, String desc, Integer min, Integer max, String units, int[] value)
      Creates new application record with double data type.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      min - the record field value for minimum
      max - the record field value for maximum
      units - the record field value for units
      value - the record initial value
      Returns:
      newly created record
    • createRecord

      public Record createRecord(String name, String desc, Double min, Double max, String units, short precision, double[] value)
      Creates new application record with double array data type.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      min - the record field value for minimum
      max - the record field value for maximum
      units - the record field value for units
      precision - the record field value for precision
      value - the record initial value
      Returns:
      newly created record
    • createRecord

      public Record createRecord(String name, String desc, gov.aps.jca.dbr.DBRType type, Object... value)
      Creates new application record with Byte data type, which can be used as boolean record.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      type - a DBRType object
      value - the record initial value
      Returns:
      newly created record
    • createRecord

      public Record createRecord(String name, String desc, boolean value)
      Creates new application record with Byte data type, which can be used as boolean record.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      value - the record initial value
      Returns:
      newly created record
    • createRecord

      public Record createRecord(String name, String desc, boolean value, boolean fixed)
      Creates new application record with Byte data type, which can be used as boolean record. Record value is fixed.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      value - the record initial value
      fixed - if true then record value is fixed and can not be changed
      Returns:
      newly created record
    • createRecord

      public Record createRecord(String name, String desc, String... value)
      Creates new application record with String array data type.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      value - the record initial value
      Returns:
      newly created record
    • createRecord

      public Record createRecord(String name, String desc, byte[] value)

      createRecord.

      Parameters:
      name - a String object
      desc - a String object
      value - an array of
      invalid reference
      byte
      objects
      Returns:
      a Record object
    • createRecord

      public Record createRecord(String name, String desc, String[] labels, short value)
      Creates new application record with Enum data type.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      labels - the record field with enum labels
      value - the record initial value
      Returns:
      newly created record
    • createRecord

      public Record createRecord(String name, String desc, long timeout)
      Creates record with command processor.
      Parameters:
      name - the record name, together with application name as prefix makes PV name of record.
      desc - the record description
      timeout - timeout for command to return value to 0;
      Returns:
      a Record object
    • connectLinks

      public ValueLinks connectLinks(String name, String... linkNames)
      Starts ValueLink connection to provided list of link names.
      Overrides:
      connectLinks in class AbstractApplication
      Parameters:
      name - the unique name of ValueLink connection
      linkNames - list of link names to be managed by single ValueLinks connection
      Returns:
      a ValueLinks object
      See Also:
    • shutdown

      public void shutdown()
      Closes the application and shuts down the embedded server.