Skip to content

Commit

Permalink
Bug fixes to stopHandler (hook it up to the context path, and allow i…
Browse files Browse the repository at this point in the history
…t to respond before shutting down.
  • Loading branch information
Gideon Kowadlo committed Jul 21, 2016
1 parent 024bd7d commit 43eec9b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .idea/agi.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion code/core/core.iml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="libsvm" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-dbcp2:2.1.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.4.2" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
Expand All @@ -25,5 +24,6 @@
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.2" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
<orderEntry type="library" name="Maven: tw.edu.ntu.csie:libsvm:3.17" level="project" />
</component>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void addHandlers() {
HttpUtil.AddHandler( _s, HttpExportHandler.CONTEXT, exh );
HttpUtil.AddHandler( _s, HttpConfigHandler.CONTEXT, ch );
HttpUtil.AddHandler( _s, HttpVersionHandler.CONTEXT, vh );
HttpUtil.AddHandler( _s, HttpStopHandler.CONTEXT, vh );
HttpUtil.AddHandler( _s, HttpStopHandler.CONTEXT, sh );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,11 @@ public void handle( HttpExchange t ) throws IOException {
String response = "Bad request.";
int status = 400;

try {
_n.stop();

status = 200;
response = "Stopping node...";
}
catch( Exception e ) {
logger.error( e.getStackTrace() );
}
status = 200;
response = "Stopping node...";

HttpUtil.SendResponse( t, status, response );

_n.stop();
}
}

0 comments on commit 43eec9b

Please sign in to comment.