Class SimpleServer


  • public class SimpleServer
    extends org.griphyn.vdl.toolkit.Toolkit
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.apache.log4j.Logger c_logger  
      static boolean c_terminate  
      (package private) org.griphyn.vdl.dbschema.DatabaseSchema m_dbschema  
      private boolean m_emptyFail  
      private boolean m_noDBase  
      (package private) InvocationParser m_parser  
      (package private) java.net.ServerSocket m_server  
      private static int port  
      • Fields inherited from class org.griphyn.vdl.toolkit.Toolkit

        m_application, m_home, m_logger, m_props, m_verbosity
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleServer​(int port)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int checkFile​(java.lang.String filename)
      Reads the contents of the specified file, and returns with the remote exit code contained in the job chain.
      private int determineExitStatus​(InvocationRecord ivr)
      Determines the exit code of an invocation record.
      private java.lang.String extractToMemory​(java.io.File input)
      Copy the content of the file into memory.
      static boolean getTerminate()  
      static void main​(java.lang.String[] args)  
      static void setTerminate​(boolean b)  
      void showUsage()
      Prints the short usage string onto stdout.
      • Methods inherited from class org.griphyn.vdl.toolkit.Toolkit

        getVerbosity, increaseVerbosity, readFile, setVerbosity
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • c_terminate

        public static boolean c_terminate
      • c_logger

        public static org.apache.log4j.Logger c_logger
      • m_emptyFail

        private boolean m_emptyFail
      • m_noDBase

        private boolean m_noDBase
      • m_dbschema

        org.griphyn.vdl.dbschema.DatabaseSchema m_dbschema
      • m_server

        java.net.ServerSocket m_server
    • Constructor Detail

      • SimpleServer

        public SimpleServer​(int port)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • setTerminate

        public static void setTerminate​(boolean b)
      • getTerminate

        public static boolean getTerminate()
      • showUsage

        public void showUsage()
        Description copied from class: org.griphyn.vdl.toolkit.Toolkit
        Prints the short usage string onto stdout. No exiting. The application name is maintained by the c'tor.
        Specified by:
        showUsage in class org.griphyn.vdl.toolkit.Toolkit
      • extractToMemory

        private java.lang.String extractToMemory​(java.io.File input)
                                          throws org.griphyn.vdl.toolkit.FriendlyNudge
        Copy the content of the file into memory. The copy operation also weeds out anything that may have been added by the remote batch scheduler. For instance, PBS is prone to add headers and footers.
        Parameters:
        input - is the file instance from which to read contents.
        Returns:
        the result code from reading the file
        Throws:
        org.griphyn.vdl.toolkit.FriendlyNudge
      • determineExitStatus

        private int determineExitStatus​(InvocationRecord ivr)
        Determines the exit code of an invocation record. Currently, we will determine the exit code from the main job only.
        Parameters:
        ivr - is the invocation record to put into the database
        Returns:
        the status code as exit code to signal failure etc.
           0   regular exit with exit code 0
           1   regular exit with exit code > 0
           2   failure to run program from kickstart
           3   application had died on signal
           4   application was suspended (should not happen)
           5   failure in exit code parsing
           6   impossible case
         
      • checkFile

        public int checkFile​(java.lang.String filename)
        Reads the contents of the specified file, and returns with the remote exit code contained in the job chain.
        Parameters:
        filename - is the name of the file with the kickstart record.
        Returns:
        the exit code derived from the remote exit code.
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Throws:
        java.io.IOException