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
public class RuntimeServlet extends HttpServlet
Main entry point for applications.
Overrides the CocoonServlet to add some initialization.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RuntimeServlet.RunMode
The run modes
-
Field Summary
Fields Modifier and Type Field Description static String
AMETYS_HOME_DEFAULT
The default ametys home path (relative to the servlet context)static String
AMETYS_HOME_PROPERTY
Name of the servlet initialization parameter for the ametys home propertystatic String
COCOON_CONF_URL
The cocoon.xconf URLstatic String
CONFIG_FILE_NAME
The config file namestatic String
CONTEXT_CONTEXT_ROOT
Constant for storing the servlet context URL in the Avalon contextstatic String
CONTEXT_SERVLET_CONFIG
Constant for storing theServletConfig
in the Avalon contextstatic int
DEFAULT_MAX_UPLOAD_SIZE
Default max upload size (10 Mb)static String
EXTERNAL_LOCATIONS
The optional location (relative to application context) of the file that configures the list of plugins/workspaces/kernel to get somewhere else
-
Constructor Summary
Constructors Constructor Description RuntimeServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
static boolean
doMigrationAndInit(PluginsComponentManager pluginCM)
Init migration and pluginsstatic RuntimeServlet.RunMode
getRunMode()
Get the run modevoid
init()
void
restartCocoon(HttpServletRequest req)
Restart cocoonvoid
service(HttpServletRequest req, HttpServletResponse res)
static void
setRunMode(RuntimeServlet.RunMode mode)
Set the run mode-
Methods 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 Detail
-
CONTEXT_SERVLET_CONFIG
public static final String CONTEXT_SERVLET_CONFIG
Constant for storing theServletConfig
in the Avalon context- See Also:
- Constant Field Values
-
CONTEXT_CONTEXT_ROOT
public static final String CONTEXT_CONTEXT_ROOT
Constant for storing the servlet context URL in the Avalon context- See Also:
- Constant Field Values
-
COCOON_CONF_URL
public static final String COCOON_CONF_URL
The cocoon.xconf URL- See Also:
- Constant Field Values
-
DEFAULT_MAX_UPLOAD_SIZE
public static final int DEFAULT_MAX_UPLOAD_SIZE
Default max upload size (10 Mb)- See Also:
- Constant Field Values
-
CONFIG_FILE_NAME
public static final String CONFIG_FILE_NAME
The config file name- See Also:
- Constant Field Values
-
AMETYS_HOME_PROPERTY
public static final String AMETYS_HOME_PROPERTY
Name of the servlet initialization parameter for the ametys home property- See Also:
- Constant Field Values
-
AMETYS_HOME_DEFAULT
public static final String AMETYS_HOME_DEFAULT
The default ametys home path (relative to the servlet context)- See Also:
- Constant Field Values
-
EXTERNAL_LOCATIONS
public static final String 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:
- Constant Field Values
-
-
Constructor Detail
-
RuntimeServlet
public RuntimeServlet()
-
-
Method Detail
-
init
public void init() throws ServletException
- Overrides:
init
in classGenericServlet
- Throws:
ServletException
-
doMigrationAndInit
public static boolean doMigrationAndInit(PluginsComponentManager pluginCM) throws Exception
Init migration and plugins- Parameters:
pluginCM
- Plugins Component Manager- Returns:
- true if a server restart is required
- Throws:
Exception
- Something went wrong
-
destroy
public void 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
public void restartCocoon(HttpServletRequest req)
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
public static void setRunMode(RuntimeServlet.RunMode mode)
Set the run mode- Parameters:
mode
- the running mode
-
getRunMode
public static RuntimeServlet.RunMode getRunMode()
Get the run mode- Returns:
- the current run mode
-
-