Class Server

java.lang.Object
com.cosylab.epics.caj.cas.util.DefaultServerImpl
org.scictrl.csshell.epics.server.Server
All Implemented Interfaces:
gov.aps.jca.cas.Server, Runnable

public class Server extends com.cosylab.epics.caj.cas.util.DefaultServerImpl implements Runnable

Server class.

Author:
igor@scictrl.com
  • Field Details

    • APPSERVER

      public static final String APPSERVER
      Constant APPSERVER="AppServer"
      See Also:
    • APPSERVER_INIT_FILE

      public static final String APPSERVER_INIT_FILE
      System property name, which is first checked, when server starts. Provides name of file with server initialization properties, which defines which serve to run and which configuration to load.
      See Also:
    • APPSERVER_INPUT

      public static final String APPSERVER_INPUT
      System property name usually provided trough init file, which define which input file with runtime configuration to load into app server. This property is mandatory, if not provided, server will not start.
      See Also:
    • APPSERVER_ALARM_EXPORT

      public static final String APPSERVER_ALARM_EXPORT
      System property name which defines XML file name into which CSS Beast alarm server configuration is exported.# IF this property is missing, then alarm export will be disabled.
      See Also:
    • APPSERVER_ALARM_CONFIG_NAME

      public static final String APPSERVER_ALARM_CONFIG_NAME
      Constant APPSERVER_ALARM_CONFIG_NAME="AppServer.alarmConfigName"
      See Also:
    • APPSERVER_CONFIG_NAME

      public static final String APPSERVER_CONFIG_NAME
      Constant APPSERVER_CONFIG_NAME="AppServer.configName"
      See Also:
    • APPSERVER_PASSPHRASE

      public static final String APPSERVER_PASSPHRASE
      Constant APPSERVER_PASSPHRASE="AppServer.passphrase"
      See Also:
    • APPSERVER_EXPORT_ONLY

      public static final String APPSERVER_EXPORT_ONLY
      System property name which instructs app server only to export alarm configuration and then exit. This functionality is used when only conversion of alarm configuration formats is required.
      See Also:
    • APPSERVER_PERSISTENCY_FILE

      public static final String APPSERVER_PERSISTENCY_FILE
      Constant APPSERVER_PERSISTENCY_FILE="AppServer.persistencyFile"
      See Also:
    • DEFAULT_ALARM_CONFIG_NAME

      public static final String DEFAULT_ALARM_CONFIG_NAME
      Constant DEFAULT_ALARM_CONFIG_NAME="ANKA Machine"
      See Also:
    • DEFAULT_CONFIG_NAME

      public static final String DEFAULT_CONFIG_NAME
      Constant DEFAULT_CONFIG_NAME="default"
      See Also:
    • DEFAULT_PASSPHRASE

      public static final String DEFAULT_PASSPHRASE
      Constant DEFAULT_PASSPHRASE="please"
      See Also:
    • DEFAULT_PERSISTENCY_FILE

      public static final String DEFAULT_PERSISTENCY_FILE
      Constant DEFAULT_PERSISTENCY_FILE="var/persistency.xml"
      See Also:
    • DEFAULT_INIT_FILE

      public static final String DEFAULT_INIT_FILE
      Default value taken for system AppServer.input (APPSERVER_INIT_FILE APPSERVER_INIT_FILE). If no AppServer.init parameter was provided, then this file name will be searched for and loaded.
      See Also:
  • Constructor Details

    • Server

      public Server() throws RemoteException, org.apache.commons.configuration.ConfigurationException

      Constructor for Server.

      Throws:
      RemoteException - if initialization of access to EPICS fails
      org.apache.commons.configuration.ConfigurationException - configuration fail
    • Server

      public Server(Properties prop) throws RemoteException, org.apache.commons.configuration.ConfigurationException

      Constructor for Server.

      Parameters:
      prop - a Properties object
      Throws:
      RemoteException - if any.
      org.apache.commons.configuration.ConfigurationException - if any.
    • Server

      public Server(boolean embedded) throws RemoteException, org.apache.commons.configuration.ConfigurationException

      Constructor for Server.

      Parameters:
      embedded - a boolean
      Throws:
      RemoteException - if initialization of access to EPICS fails
      org.apache.commons.configuration.ConfigurationException - configuration fail
    • Server

      public Server(Properties prop, boolean embedded) throws RemoteException, org.apache.commons.configuration.ConfigurationException

      Constructor for Server.

      Parameters:
      prop - a Properties object
      embedded - a boolean
      Throws:
      RemoteException - if any.
      org.apache.commons.configuration.ConfigurationException - if any.
  • Method Details

    • main

      public static void main(String[] args)

      main.

      Parameters:
      args - an array of String objects
    • isEmbedded

      public boolean isEmbedded()

      isEmbedded.

      Returns:
      a boolean
    • getInputData

      Getter for the field inputData.

      Returns:
      a ConfigurationManager.ConfigurationVisitor object
    • setInputData

      public void setInputData(ConfigurationManager.ConfigurationVisitor inputData)

      Setter for the field inputData.

      Parameters:
      inputData - a ConfigurationManager.ConfigurationVisitor object
    • getConfiguration

      public Properties getConfiguration()

      Getter for the field configuration.

      Returns:
      a Properties object
    • isActive

      public boolean isActive()

      isActive.

      Returns:
      a boolean
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • activate

      public void activate() throws gov.aps.jca.CAException

      activate.

      Throws:
      gov.aps.jca.CAException - if any.
    • getDatabase

      public Database getDatabase()

      Getter for the field database.

      Returns:
      a Database object
    • processVariableExistanceTest

      public gov.aps.jca.cas.ProcessVariableExistanceCompletion processVariableExistanceTest(String aliasName, InetSocketAddress clientAddress, gov.aps.jca.cas.ProcessVariableExistanceCallback asyncCompletionCallback) throws gov.aps.jca.CAException, IllegalArgumentException, IllegalStateException
      Specified by:
      processVariableExistanceTest in interface gov.aps.jca.cas.Server
      Overrides:
      processVariableExistanceTest in class com.cosylab.epics.caj.cas.util.DefaultServerImpl
      Throws:
      gov.aps.jca.CAException
      IllegalArgumentException
      IllegalStateException
    • processVariableAttach

      public gov.aps.jca.cas.ProcessVariable processVariableAttach(String aliasName, gov.aps.jca.cas.ProcessVariableEventCallback eventCallback, gov.aps.jca.cas.ProcessVariableAttachCallback asyncCompletionCallback) throws gov.aps.jca.CAStatusException, IllegalArgumentException, IllegalStateException
      Specified by:
      processVariableAttach in interface gov.aps.jca.cas.Server
      Overrides:
      processVariableAttach in class com.cosylab.epics.caj.cas.util.DefaultServerImpl
      Throws:
      gov.aps.jca.CAStatusException
      IllegalArgumentException
      IllegalStateException
    • requestShutdown

      public boolean requestShutdown(String passphrase)

      requestShutdown.

      Parameters:
      passphrase - a String object
      Returns:
      a boolean
    • destroy

      public void destroy()

      destroy.

    • pvCount

      public int pvCount()
      Number of PV connections made to this server
      Returns:
      nuber of PV connections to this server
    • recordCount

      public int recordCount()

      recordCount.

      Returns:
      a int