Changeset 32050 for main/trunk


Ignore:
Timestamp:
2017-10-20T19:13:00+13:00 (6 years ago)
Author:
ak19
Message:

Related to previous commit, revision 32049. Now tested successfully on Windows. Suppressing some debug statements.

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r32049 r32050  
    411411                       
    412412                        System.err.println("ShutDownHook called...");
    413                         System.err.println("Attempting to forcibly terminate the GS server...");
    414413
    415414                        if (GS3) { // issue the ant call to stop any running GS3
    416415                        // (tomcat and networked Derby Server) by calling GS3ServerThread.stopServer()
    417416                        if(!GS3ServerThread.wasServerLaunchedOutsideGLI()) {
     417                            System.err.println("Attempting to forcibly terminate the GS server...");
    418418                            GS3ServerThread.stopServer();
    419419                        } else {
     
    422422                        } else { // issue the call to stop any running GS2 local library server
    423423                        if (LocalLibraryServer.isRunning() == true) {
     424                            System.err.println("Attempting to forcibly terminate the GS server...");
    424425                            LocalLibraryServer.forceStopServer();
    425426                        }
     
    437438
    438439                    if(!GS3ServerThread.wasServerLaunchedOutsideGLI()) {
    439                     System.err.println("@@@@ Launching tomcat from GLI");
     440                    //System.err.println("@@@@ Launching tomcat from GLI");
    440441                    GS3ServerThread thread = new GS3ServerThread(gsdl3_src_path, "restart");
    441442                    thread.start();
     
    820821            //thread.start();
    821822            if(!GS3ServerThread.wasServerLaunchedOutsideGLI()) {
    822             System.err.println("@@@@ Off to call stopServer");
    823823            GS3ServerThread.stopServer();
    824824            } else {
  • main/trunk/gli/src/org/greenstone/gatherer/util/GS3ServerThread.java

    r32049 r32050  
    4949    String _ant_command = "";
    5050
    51     // isIndependentServer is true/1 if tomcat was already running when GLI was started up
    52     // in which case GLI doesn't need to ask tomcat to be run, nor does it need to stop the server on exit
    53     // Value can be -1, 0 or 1. -1 means not yet determined. 0 is false, 1 is true
     51    // isIndependentServer is true if tomcat was already running when GLI was started up
     52    // in which case GLI doesn't need start tomcat itself, nor should it need to stop the server on exit
    5453    static private final boolean isIndependentServer = GS3ServerThread.isServerRunning();
    55 
    56     /*static {
    57     isIndependentServer = isServerRunning();
    58     }*/
    5954   
    6055    public GS3ServerThread(String gsdl3_src_path, String ant_command)
     
    160155    SafeProcess p = null;
    161156    if (Utility.isWindows()) {
    162         // cmd /C "cd "C:\path\to\greenstone3" && ant stop"
    163157        p = new SafeProcess("cmd /C \"cd \"" + Configuration.gsdl3_src_path + File.separator + "\" && "+antCmd+"\"");   
    164158    } else {
     
    166160    }
    167161   
    168     System.err.println("**** Checking if tomcat is running");
     162    //System.err.println("**** Checking if tomcat is running");
    169163    p.runProcess();
    170164    String output = p.getStdOutput();
    171165
    172166    if(output.contains("Tomcat is running: true")) {
    173         System.err.println("**** Tomcat was running");
     167        //System.err.println("**** Tomcat was running");
    174168        return true;
    175169    }
    176170   
    177     System.err.println("**** Tomcat was not running");
     171    //System.err.println("**** Tomcat was not running");
    178172    return false;
    179173    }
     
    181175    // first time, call this on startup, before running GS3ServerThread
    182176    public static boolean wasServerLaunchedOutsideGLI() {
    183     System.err.println("@@@ Was server launched outside GLI: " + isIndependentServer);
     177    //System.err.println("@@@ Was server launched outside GLI: " + isIndependentServer);
    184178    return isIndependentServer;
    185179    }
Note: See TracChangeset for help on using the changeset viewer.