- Timestamp:
- 2010-08-17T18:25:53+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/server/Server2.java
r22085 r22660 51 51 // wait for a connection 52 52 connection = serverSocket.accept(); 53 boolean stop = false; 53 54 54 55 // read input … … 56 57 BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); 57 58 String line = null; 58 if((line = reader.readLine()) != null) {59 while((line = reader.readLine()) != null) { 59 60 if(line.equals("QUIT")) { 61 stop = true; 60 62 // Server2.this.recordSuccess("In QuitListener - line is QUIT"); 61 63 reader.close(); … … 63 65 serverSocket.close(); 64 66 serverSocket = null; 67 break; 68 } else if(line.equals("RECONFIGURE")) { 69 server_control_.displayMessage(dictionary.get("ServerControl.Configuring")); 70 reconfigRequired(); 71 } else if(line.equals("RESTART")) { 72 73 // If the GSI is set to NOT autoenter/autostart the server, then write url=URL_PENDING out to the file. 74 // When the user finally presses the Enter Library button and so has started up the server, the correct 75 // url will be written out to the configfile. 76 if(config_properties.getProperty(BaseServer.Property.AUTOSTART, "").equals("0")) { 77 if(config_properties.getProperty("url") == null) { 78 config_properties.setProperty("url", URL_PENDING); 79 ScriptReadWrite scriptReadWrite = new ScriptReadWrite(); 80 ArrayList fileLines = scriptReadWrite.readInFile(BaseServer.config_properties_file); 81 scriptReadWrite.replaceOrAddLine(fileLines, "url", URL_PENDING, true); 82 scriptReadWrite.writeOutFile(config_properties_file, fileLines); 83 } 84 } 85 86 autoStart(); 65 87 } 66 88 } … … 68 90 Server2.this.recordError("Exception in QuitListener thread."); 69 91 } finally { 70 Server2.this.stop(); 71 System.exit(0); 92 if(stop) { 93 Server2.this.stop(); 94 System.exit(0); 95 } 72 96 } 73 97 } catch(IOException ioe) {
Note:
See TracChangeset
for help on using the changeset viewer.