Changeset 24333
- Timestamp:
- 2011-07-25T16:25:49+12:00 (12 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r24296 r24333 58 58 import org.greenstone.gatherer.metadata.FilenameEncoding; 59 59 import org.greenstone.gatherer.remote.RemoteGreenstoneServer; 60 import org.greenstone.gatherer.util.GS3ServerThread; 60 61 import org.greenstone.gatherer.util.JarTools; 61 62 import org.greenstone.gatherer.util.StaticStrings; … … 372 373 } 373 374 else { 374 GS3ServerThread thread = new GS3ServerThread(gsdl_path );375 GS3ServerThread thread = new GS3ServerThread(gsdl_path, "start"); 375 376 thread.start(); 376 377 } … … 705 706 if (isGsdlRemote) { 706 707 remoteGreenstoneServer.exit(); 708 } else if (GS3) { // stop the local tomcat web server when running GS3 709 // can't call ant stop from its own thread - what if GLI has exited by then? 710 // issue call to ant stop from the main GLI thread 711 //GS3ServerThread thread = new GS3ServerThread(Configuration.gsdl_path, "stop"); 712 //thread.start(); 713 714 try { 715 String shellCommand = null; 716 Process p = null; 717 if (Utility.isWindows()) { 718 p = Runtime.getRuntime().exec("cmd /C \"cd " + Configuration.gsdl_path + File.separator + ".. && ant stop\"\""); 719 } else { 720 p = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "ant stop -f \"" + Configuration.gsdl_path + ".." + File.separator + "build.xml\""}); 721 } 722 } catch(Exception e) { 723 System.err.println("Exception when trying to stop the tomcat web server: " + e); 724 DebugStream.printStackTrace(e); 725 } 726 707 727 } 708 728 … … 1595 1615 } 1596 1616 1597 public class GS3ServerThread extends Thread1598 {1599 String _gsdl_path = "";1600 1601 public GS3ServerThread(String gsdl_path)1602 {1603 _gsdl_path = gsdl_path;1604 }1605 1606 public void run()1607 {1608 try1609 {1610 String shellCommand = null;1611 Process p = null;1612 if (Utility.isWindows())1613 {1614 p = Runtime.getRuntime().exec("cmd /C \"cd " + _gsdl_path + File.separator + ".. && ant start\"\"");1615 }1616 else1617 {1618 p = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "ant restart -f \"" + _gsdl_path + ".." + File.separator + "build.xml\""});1619 }1620 }1621 catch(Exception ex)1622 {1623 ex.printStackTrace();1624 }1625 }1626 }1627 1617 }
Note:
See TracChangeset
for help on using the changeset viewer.