Package org.ametys.runtime.servlet
Class RuntimeServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.ametys.runtime.servlet.RuntimeServlet
- All Implemented Interfaces:
- Serializable,- Servlet,- ServletConfig
Main entry point for applications.
Overrides the CocoonServlet to add some initialization.
Overrides the CocoonServlet to add some initialization.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final recordInformations about the maintenance status when forcedstatic enumThe maintenance status of Ametysstatic enumThe run modes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe default ametys home path (relative to the servlet context)static final StringName of the servlet initialization parameter for the ametys home propertystatic final StringThe cocoon.xconf URLstatic final StringThe config file namestatic final StringConstant for storing the servlet context URL in the Avalon contextstatic final StringConstant for storing theServletConfigin the Avalon contextstatic final intDefault max upload size (10 Mb)static final StringThe optional location (relative to application context) of the file that configures the list of plugins/workspaces/kernel to get somewhere elsestatic final StringFile name in the administrator folder of the ametys homestatic final StringThe maintenance file name
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoiddestroy()static booleandoMigrationAndInit(PluginsComponentManager pluginCM) Init migration and pluginsstatic StringGet the instance identifierGet the current maintenance statusWhen maintenance status is forced, this comment may explains whystatic RuntimeServlet.RunModeGet the run modevoidinit()voidRestart cocoonfinal voidservice(HttpServletRequest req, HttpServletResponse res) static voidsetMaintenanceStatus(RuntimeServlet.MaintenanceStatus maintenanceStatus, RuntimeServlet.ForcedMainteanceInformations forcedMainteanceInformations) Set the maintenance statusstatic voidSet the run modeMethods inherited from class javax.servlet.http.HttpServletdoDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class javax.servlet.GenericServletgetInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
- 
Field Details- 
CONTEXT_SERVLET_CONFIGConstant for storing theServletConfigin the Avalon context- See Also:
 
- 
CONTEXT_CONTEXT_ROOTConstant for storing the servlet context URL in the Avalon context- See Also:
 
- 
COCOON_CONF_URLThe cocoon.xconf URL- See Also:
 
- 
DEFAULT_MAX_UPLOAD_SIZEDefault max upload size (10 Mb)- See Also:
 
- 
MAINTENANCE_FILENAMEThe maintenance file name- See Also:
 
- 
CONFIG_FILE_NAMEThe config file name- See Also:
 
- 
AMETYS_HOME_PROPERTYName of the servlet initialization parameter for the ametys home property- See Also:
 
- 
AMETYS_HOME_DEFAULTThe default ametys home path (relative to the servlet context)- See Also:
 
- 
EXTERNAL_LOCATIONSThe optional location (relative to application context) of the file that configures the list of plugins/workspaces/kernel to get somewhere else- See Also:
 
- 
INSTANCE_FILENAMEFile name in the administrator folder of the ametys home- See Also:
 
 
- 
- 
Constructor Details- 
RuntimeServletpublic RuntimeServlet()
 
- 
- 
Method Details- 
init- Overrides:
- initin class- GenericServlet
- Throws:
- ServletException
 
- 
getInstanceIdGet the instance identifier- Returns:
- The UUID of the Ametys instance or null if the id could not be generated at startup
- Throws:
- IllegalStateException- If the file cannot be read
 
- 
doMigrationAndInitInit migration and plugins- Parameters:
- pluginCM- Plugins Component Manager
- Returns:
- true if a server restart is required
- Throws:
- Exception- Something went wrong
 
- 
destroy- Specified by:
- destroyin interface- Servlet
- Overrides:
- destroyin class- GenericServlet
 
- 
servicepublic final void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException - Overrides:
- servicein class- HttpServlet
- Throws:
- ServletException
- IOException
 
- 
restartCocoonRestart cocoon- Parameters:
- req- The http servlet request, used to read safeMode and normalMode request attribute if possible. If null, safe mode will be forced only if it was already forced.
 
- 
setMaintenanceStatuspublic static void setMaintenanceStatus(RuntimeServlet.MaintenanceStatus maintenanceStatus, RuntimeServlet.ForcedMainteanceInformations forcedMainteanceInformations) Set the maintenance status- Parameters:
- maintenanceStatus- The new maintenance status. Cannot be null.
- forcedMainteanceInformations- The informations if the mode is FORCED. Can be null.
 
- 
getMaintenanceStatusGet the current maintenance status- Returns:
- The maintenance status
 
- 
getMaintenanceStatusForcedInformationsWhen maintenance status is forced, this comment may explains why- Returns:
- The comment. Can be null even in forced mode.
 
- 
setRunModeSet the run mode- Parameters:
- mode- the running mode
 
- 
getRunModeGet the run mode- Returns:
- the current run mode
 
 
-