Ignore:
Timestamp:
2017-05-08T21:18:21+12:00 (7 years ago)
Author:
ak19
Message:

GS3 source code now updated to use SafeProcess instead of Process (calling Runtime.exec() directly). The use of SafeProcess in RunTarget and BrowserLauncher has been tested on Linux. GDBMWrapper, MapRetrieve and admin/guiext's Command.java are not tested. For GDBMWrapper, because it's in a bit of code that works with txtgz databases. MapRetrive.java and Command.java are untested because I don't know how to test them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/server/BaseServer.java

    r24479 r31665  
    8686        if (configure_required_){
    8787        server_control_.displayMessage(dictionary.get("ServerControl.Configuring"));
    88         int state = runTarget(CONFIGURE_CMD);
     88        int state = run(CONFIGURE_CMD);
    8989       
    9090        if (state != RunTarget.SUCCESS){
     
    114114
    115115    protected abstract int runTarget(String cmd);
     116
     117    protected int run(String cmd) {
     118    int result = runTarget(cmd);
     119    server_control_.repaint();
     120    // from Java 7, can just call revalidate() instead of invalidate() and validate():
     121    server_control_.invalidate();
     122    server_control_.validate();
     123    return result;
     124    }
     125
    116126    public abstract String getBrowserURL();
    117127    public abstract void reload(); // reload properties, since they may have changed
     
    136146        if (configure_required_){
    137147        server_control_.displayMessage(dictionary.get("ServerControl.Configuring"));
    138         state = runTarget(CONFIGURE_CMD);
     148        state = run(CONFIGURE_CMD);
    139149       
    140150       if (state != RunTarget.SUCCESS){
     
    153163        logger_.error("Exception trying to sleep: " + e);
    154164    }
    155         state = runTarget(START_CMD);
     165        state = run(START_CMD);
    156166   
    157167    if (state != RunTarget.SUCCESS){
     
    239249        server_control_.displayMessage(dictionary.get("ServerControl.Stopping"));
    240250    }
    241     int state = runTarget(STOP_CMD);
     251    int state = run(STOP_CMD);
    242252   
    243253        if (state != RunTarget.SUCCESS){
Note: See TracChangeset for help on using the changeset viewer.