Class SimpleServer
- java.lang.Object
-
- org.griphyn.vdl.toolkit.Toolkit
-
- edu.isi.pegasus.planner.invocation.SimpleServer
-
public class SimpleServer extends org.griphyn.vdl.toolkit.Toolkit
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.log4j.Loggerc_loggerstatic booleanc_terminate(package private) org.griphyn.vdl.dbschema.DatabaseSchemam_dbschemaprivate booleanm_emptyFailprivate booleanm_noDBase(package private) InvocationParserm_parser(package private) java.net.ServerSocketm_serverprivate static intport
-
Constructor Summary
Constructors Constructor Description SimpleServer(int port)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcheckFile(java.lang.String filename)Reads the contents of the specified file, and returns with the remote exit code contained in the job chain.private intdetermineExitStatus(InvocationRecord ivr)Determines the exit code of an invocation record.private java.lang.StringextractToMemory(java.io.File input)Copy the content of the file into memory.static booleangetTerminate()static voidmain(java.lang.String[] args)static voidsetTerminate(boolean b)voidshowUsage()Prints the short usage string onto stdout.
-
-
-
Field Detail
-
port
private static final int port
- See Also:
- Constant Field Values
-
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_parser
InvocationParser m_parser
-
m_server
java.net.ServerSocket m_server
-
-
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.ToolkitPrints the short usage string onto stdout. No exiting. The application name is maintained by the c'tor.- Specified by:
showUsagein classorg.griphyn.vdl.toolkit.Toolkit
-
extractToMemory
private java.lang.String extractToMemory(java.io.File input) throws org.griphyn.vdl.toolkit.FriendlyNudgeCopy 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
-
-