Changeset 19243

Show
Ignore:
Timestamp:
23.04.2009 19:04:51 (10 years ago)
Author:
ak19
Message:

The length of time to wait for the server to startup or stop is stored ina variable (better to keep this length somewhat similar to how long greenstone3's src code server/Server2.java waits).

Location:
gli/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • gli/trunk/classes/dictionary.properties

    r18964 r19243  
    994994# 
    995995Server.QuitManual:The Librarian Interface was unable to close the local\nlibrary server automatically. Please exit the server\nmanually by clicking on the cross icon in its top\nright-hand corner, then click OK on this dialog. 
    996 Server.QuitTimeOut:The greenstone local library has not responded to the\nautomatic close command for sixty seconds. Do you\nwish to wait for another minute? 
     996Server.QuitTimeOut:The greenstone local library has not responded to the\nautomatic close command for {0} seconds. Do you\nwish to wait for another {0} seconds? 
     997Server.StartUpTimeOut:The greenstone local library has not responded to the\nstart command for {0} seconds. Do you\nwish to wait for another {0} seconds? 
    997998# 
    998999#***** Sources ***** 
  • gli/trunk/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java

    r19203 r19243  
    4343public class LocalLibraryServer 
    4444{ 
     45    static final private int WAITING_TIME = 60; // number of seconds to wait for the server to start and stop 
     46 
    4547    static final private String ADD_COMMAND = "?a=config&cmd=add-collection&c="; 
    4648    static final private String RELEASE_COMMAND = "?a=config&cmd=release-collection&c="; 
     
    258260        attempt_count++; 
    259261 
    260         // After waiting a minute ask the user whether they want to wait another minute 
    261         if (attempt_count == 60) { 
    262         int try_again = JOptionPane.showConfirmDialog(Gatherer.g_man, Dictionary.get("Server.QuitTimeOut"), Dictionary.get("General.Warning"), JOptionPane.YES_NO_OPTION); 
     262        // After waiting for the specified time, ask the user whether they want to wait for that long again 
     263        if (attempt_count == WAITING_TIME) { 
     264        int try_again = JOptionPane.showConfirmDialog(Gatherer.g_man, Dictionary.get("Server.QuitTimeOut", Integer.toString(WAITING_TIME)), 
     265                                  Dictionary.get("General.Warning"), JOptionPane.YES_NO_OPTION); 
    263266        if (try_again == JOptionPane.NO_OPTION) { 
    264267            return; 
     
    310313        attempt_count++; 
    311314 
    312         // After waiting a minute ask the user whether they want to wait another minute 
    313         if (attempt_count == 60) { 
    314         int try_again = JOptionPane.showConfirmDialog(Gatherer.g_man, Dictionary.get("Server.QuitTimeOut"), Dictionary.get("General.Warning"), JOptionPane.YES_NO_OPTION); 
     315        // After waiting for the specified time, ask the user whether they want to wait for that long again 
     316        if (attempt_count == WAITING_TIME) { 
     317        int try_again = JOptionPane.showConfirmDialog(Gatherer.g_man, Dictionary.get("Server.StartUpTimeOut", Integer.toString(WAITING_TIME)), 
     318                                  Dictionary.get("General.Warning"), JOptionPane.YES_NO_OPTION); 
    315319        if (try_again == JOptionPane.NO_OPTION) { 
    316320            return;