-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
dotCMS/src/main/java/com/dotmarketing/servlets/FinalStartupServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.dotmarketing.servlets; | ||
|
||
import com.dotmarketing.util.Config; | ||
import com.dotmarketing.util.Logger; | ||
import javax.servlet.ServletConfig; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.http.HttpServlet; | ||
//import javax.servlet.annotation.WebServlet; | ||
|
||
/** | ||
* This servlet is used to check if the server should be shutdown on startup. | ||
* If the property shutdown-on-startup is set to true, the server will be shutdown | ||
* The loadOnStartup is set to the highest value to ensure it is run after all other servlets that are not | ||
* lazy loaded | ||
*/ | ||
public class FinalStartupServlet extends HttpServlet { | ||
|
||
// init method | ||
@Override | ||
public void init(ServletConfig cfg) throws ServletException { | ||
super.init(cfg); | ||
Logger.info(this, "Starting FinalStartupServlet"); | ||
if (Config.getBooleanProperty("shutdown-on-startup", false)) { | ||
Logger.info(this, "shutdown-on-startup is true, shutting down the server"); | ||
System.exit(0); | ||
} | ||
} | ||
|
||
@Override | ||
public void destroy() { | ||
Logger.info(this, "FinalStartupServlet destroyed"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters