private ReturnCode createDumps ( Set < JavaDumpAction > javaDumpActions , boolean introspect , String dumpTimestamp ) { ServerLock serverLock = ServerLock . createTestLock ( bootProps ) ; ReturnCode dumpRc = ReturnCode . OK ; // The lock file may have been (erroneously) deleted: this can happen on linux boolean lockExists = serverLock . lockFileExists ( ) ; if ( lockExists ) { if ( serverLock . testServerRunning ( ) ) { // server is running ServerCommandClient scc = new ServerCommandClient ( bootProps ) ; if ( scc . isValid ( ) ) { //check .sCommand exist if ( introspect ) { dumpRc = scc . introspectServer ( dumpTimestamp , javaDumpActions ) ; } else { dumpRc = scc . javaDump ( javaDumpActions ) ; } } else { // we have a server holding a lock that we can't talk to... // the dump is likely fine.. but we don't know / can't tell dumpRc = ReturnCode . SERVER_UNKNOWN_STATUS ; } } else { // nope: lock not held, we're not running dumpRc = ReturnCode . SERVER_INACTIVE_STATUS ; } } else { // no lock file: we assume the server is not running. dumpRc = ReturnCode . SERVER_INACTIVE_STATUS ; } return dumpRc ; }
Run the relevant command for dumping the system