git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix STOP server
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
fanfix
/
library
/
WebLibraryServerHtml.java
diff --git
a/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java
b/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java
index ac0631dd60ba32abc8f34b7297510bbc78039c95..7351d0dd3665bceffb58b02574345dfcb498d940 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java
+++ b/
src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java
@@
-70,6
+70,13
@@
abstract class WebLibraryServerHtml implements Runnable {
protected abstract Response delete(String uri, WLoginResult login)
throws IOException;
protected abstract Response delete(String uri, WLoginResult login)
throws IOException;
+ /**
+ * Wait until all operations are done and stop the server.
+ * <p>
+ * All the new R/W operations will be refused after a call to stop.
+ */
+ protected abstract Response stop(WLoginResult login);
+
public WebLibraryServerHtml(boolean secure) throws IOException {
Integer port = Instance.getInstance().getConfig()
.getInteger(Config.SERVER_PORT);
public WebLibraryServerHtml(boolean secure) throws IOException {
Integer port = Instance.getInstance().getConfig()
.getInteger(Config.SERVER_PORT);
@@
-210,6
+217,8
@@
abstract class WebLibraryServerHtml implements Runnable {
}
} else if (WebLibraryUrls.isDeleteUrl(uri)) {
rep = delete(uri, login);
}
} else if (WebLibraryUrls.isDeleteUrl(uri)) {
rep = delete(uri, login);
+ } else if (WebLibraryUrls.EXIT_URL.equals(uri)) {
+ rep = WebLibraryServerHtml.this.stop(login);
} else {
getTraceHandler().error(
"Supported URL was not processed: "
} else {
getTraceHandler().error(
"Supported URL was not processed: "
@@
-272,6
+281,10
@@
abstract class WebLibraryServerHtml implements Runnable {
}
}
}
}
+ protected void doStop() {
+ server.stop();
+ }
+
/**
* The traces handler for this {@link WebLibraryServerHtml}.
*
/**
* The traces handler for this {@link WebLibraryServerHtml}.
*