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 Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default ametys home path (relative to the servlet context)static final String
Name of the servlet initialization parameter for the ametys home propertystatic final String
The cocoon.xconf URLstatic final String
The config file namestatic final String
Constant for storing the servlet context URL in the Avalon contextstatic final String
Constant for storing theServletConfig
in the Avalon contextstatic final int
Default max upload size (10 Mb)static final String
The optional location (relative to application context) of the file that configures the list of plugins/workspaces/kernel to get somewhere else -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
static boolean
doMigrationAndInit
(PluginsComponentManager pluginCM) Init migration and pluginsstatic RuntimeServlet.RunMode
Get the run modevoid
init()
void
Restart cocoonfinal void
service
(HttpServletRequest req, HttpServletResponse res) static void
Set the run modeMethods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
CONTEXT_SERVLET_CONFIG
Constant for storing theServletConfig
in the Avalon context- See Also:
-
CONTEXT_CONTEXT_ROOT
Constant for storing the servlet context URL in the Avalon context- See Also:
-
COCOON_CONF_URL
The cocoon.xconf URL- See Also:
-
DEFAULT_MAX_UPLOAD_SIZE
Default max upload size (10 Mb)- See Also:
-
CONFIG_FILE_NAME
The config file name- See Also:
-
AMETYS_HOME_PROPERTY
Name of the servlet initialization parameter for the ametys home property- See Also:
-
AMETYS_HOME_DEFAULT
The default ametys home path (relative to the servlet context)- See Also:
-
EXTERNAL_LOCATIONS
The optional location (relative to application context) of the file that configures the list of plugins/workspaces/kernel to get somewhere else- See Also:
-
-
Constructor Details
-
RuntimeServlet
public RuntimeServlet()
-
-
Method Details
-
init
- Overrides:
init
in classGenericServlet
- Throws:
ServletException
-
doMigrationAndInit
Init migration and plugins- Parameters:
pluginCM
- Plugins Component Manager- Returns:
- true if a server restart is required
- Throws:
Exception
- Something went wrong
-
destroy
- Specified by:
destroy
in interfaceServlet
- Overrides:
destroy
in classGenericServlet
-
service
public final void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException - Overrides:
service
in classHttpServlet
- Throws:
ServletException
IOException
-
restartCocoon
Restart 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 alread forced.
-
setRunMode
Set the run mode- Parameters:
mode
- the running mode
-
getRunMode
Get the run mode- Returns:
- the current run mode
-