aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2011-09-30 06:04:17 (EDT)
committerJesse McConnell2011-09-30 08:58:39 (EDT)
commit3e73e79c1e466b521c408110bb4bf384a9a6bb7b (patch)
treeb5891c20769d74d2052a3b5185ce397969d024d0
parent37845a1a4fcedd6f583d0de74d3dfbc629f6b0f2 (diff)
downloadorg.eclipse.jetty.project-3e73e79c1e466b521c408110bb4bf384a9a6bb7b.zip
org.eclipse.jetty.project-3e73e79c1e466b521c408110bb4bf384a9a6bb7b.tar.gz
org.eclipse.jetty.project-3e73e79c1e466b521c408110bb4bf384a9a6bb7b.tar.bz2
code convention fixes, javadoc update
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java
index a0edc40..68e387b 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java
@@ -26,8 +26,10 @@ import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */
/**
- * A handler that shuts the server down on a valid request. Used to do "soft" restarts from Java. This handler is a contribution from Johannes Brodwall:
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=357687
+ * A handler that shuts the server down on a valid request. Used to do "soft" restarts from Java. If _exitJvm ist set to true a hard System.exit() call is being
+ * made.
+ *
+ * This handler is a contribution from Johannes Brodwall: https://bugs.eclipse.org/bugs/show_bug.cgi?id=357687
*
* Usage:
*
@@ -44,11 +46,11 @@ public class ShutdownHandler extends AbstractHandler
{
private static final Logger LOG = Log.getLogger(ShutdownHandler.class);
- private final String shutdownToken;
+ private final String _shutdownToken;
- private final Server jettyServer;
+ private final Server _jettyServer;
- private boolean exitJvm = false;
+ private boolean _exitJvm = false;
/**
* Creates a listener that lets the server be shut down remotely (but only from localhost).
@@ -60,8 +62,8 @@ public class ShutdownHandler extends AbstractHandler
*/
public ShutdownHandler(Server server, String shutdownToken)
{
- this.jettyServer = server;
- this.shutdownToken = shutdownToken;
+ this._jettyServer = server;
+ this._shutdownToken = shutdownToken;
}
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
@@ -112,14 +114,19 @@ public class ShutdownHandler extends AbstractHandler
private boolean hasCorrectSecurityToken(HttpServletRequest request)
{
- return shutdownToken.equals(request.getParameter("token"));
+ return _shutdownToken.equals(request.getParameter("token"));
}
void shutdownServer() throws Exception
{
- jettyServer.stop();
- if (exitJvm)
+ _jettyServer.stop();
+ if (_exitJvm)
System.exit(0);
}
+ public void setExitJvm(boolean exitJvm)
+ {
+ this._exitJvm = exitJvm;
+ }
+
}