Class AbstractCyclingApplication

java.lang.Object
org.scictrl.csshell.epics.server.application.AbstractApplication
org.scictrl.csshell.epics.server.application.cycling.AbstractCyclingApplication
All Implemented Interfaces:
Application, OnDemandValueProcessor.ValueProvider
Direct Known Subclasses:
CyclingApplication, ITestCyclingApplication

public abstract class AbstractCyclingApplication extends AbstractApplication

Abstract AbstractCyclingApplication class.

Author:
igor@scictrl.com
  • Field Details

  • Constructor Details

    • AbstractCyclingApplication

      public AbstractCyclingApplication()
      Constructor.
  • Method Details

    • getCyclingParameters

      public final CyclingParameters getCyclingParameters(String name)

      getCyclingParameters.

      Parameters:
      name - a String object
      Returns:
      a CyclingParameters object
    • storeCyclingParameters

      public final void storeCyclingParameters(String name, CyclingParameters param)

      storeCyclingParameters.

      Parameters:
      name - a String object
      param - a CyclingParameters object
    • getMetaData

      public MetaData getMetaData()

      Getter for the field metaData.

      Returns:
      a MetaData object
    • getDevice

      public String getDevice()

      Getter for the field device.

      Returns:
      a String object
    • getParameters

      public CyclingParameters getParameters()

      Getter for the field parameters.

      Returns:
      a CyclingParameters object
    • configureDevice

      protected void configureDevice(org.apache.commons.configuration.HierarchicalConfiguration config)

      configureDevice.

      Parameters:
      config - a HierarchicalConfiguration object
    • configure

      public void configure(String name, org.apache.commons.configuration.HierarchicalConfiguration config)
      Configures the internals of this application, provides reference to configuration with root inside applications tag. Server structure is not yet initialized, so does not have reference to Database, the Database reference will be available during activate call.
      Specified by:
      configure in interface Application
      Overrides:
      configure in class AbstractApplication
      Parameters:
      name - a String object
      config - configuration with room inside application tag.
    • restoreMetaData

      protected abstract MetaData restoreMetaData()
      Implement this to provide inital metadata for the cycler. If possible use helper method restoreMetaData(String).
      Returns:
      a MetaData object
    • restoreMetaData

      protected MetaData restoreMetaData(String pvName)
      Restores metadata from local persistency store, which is identified by PV name.
      Parameters:
      pvName - the name of PV that provides the metadata.
      Returns:
      metadata from local presistancy store
    • updateLastTimeCycled

      protected void updateLastTimeCycled()

      updateLastTimeCycled.

    • updateDuration

      protected void updateDuration(CyclingParameters p)

      updateDuration.

      Parameters:
      p - a CyclingParameters object
    • activate

      public void activate()
      Application has now reference to Database. Application might want to connect to other records on this server or PVs on other servers. This can not be done until all records from configuration has been loaded. Call to this method signals application that records has been loaded and linking to other values can be commenced.
      Specified by:
      activate in interface Application
      Overrides:
      activate in class AbstractApplication
    • getAsyncMetadata

      protected abstract void getAsyncMetadata() throws Exception
      This method is called from activate and initiate asynchonous get for metadata. If possible
      Throws:
      Exception - if fails
    • getAsyncMetadata

      protected void getAsyncMetadata(String pvName) throws Exception
      Defautl implementation of getAsyncMetadata(), which uses PV to get remote metadata asynchronously.
      Parameters:
      pvName - a String object
      Throws:
      Exception - remote exception
    • 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.
    • doAbort

      protected abstract void doAbort()

      doAbort.

    • doCycle

      protected abstract void doCycle()

      doCycle.

    • doCycleTop

      protected abstract void doCycleTop()

      doCycleTop.

    • setProgress

      protected void setProgress(double p)

      setProgress.

      Parameters:
      p - a double
    • setStatus

      protected void setStatus(AbstractCyclingApplication.Status status)

      setStatus.

      Parameters:
      status - a AbstractCyclingApplication.Status object