public class RuntimeServlet extends HttpServlet
Modifier and Type | Class and Description |
---|---|
static class |
RuntimeServlet.RunMode
The run modes
|
Modifier and Type | Field and Description |
---|---|
private Collection<Pattern> |
_allowedURLPattern |
private File |
_ametysHome |
private AmetysHomeLock |
_ametysHomeLock |
private DefaultContext |
_avalonContext |
private File |
_cacheDir |
private Cocoon |
_cocoon |
private HttpContext |
_context |
private Exception |
_exception |
private Logger |
_logger |
private LoggerManager |
_loggerManager |
private int |
_maxUploadSize |
private static RuntimeServlet.RunMode |
_mode |
private RequestFactory |
_requestFactory |
private ServletContext |
_servletContext |
private String |
_servletContextPath |
private URL |
_servletContextURL |
private File |
_uploadDir |
private File |
_workDir |
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 property
|
static String |
COCOON_CONF_URL
The cocoon.xconf URL
|
static String |
CONFIG_FILE_NAME
The config file name
|
static String |
CONTEXT_CONTEXT_ROOT
Constant for storing the servlet context URL in the Avalon context
|
static String |
CONTEXT_SERVLET_CONFIG
Constant for storing the
ServletConfig in the Avalon context |
static int |
DEFAULT_MAX_UPLOAD_SIZE
Default max upload size (10 Mb)
|
Constructor and Description |
---|
RuntimeServlet() |
Modifier and Type | Method and Description |
---|---|
private void |
_createCocoon() |
private void |
_disposeCocoon() |
private void |
_fireRequestEnded(HttpServletRequest req) |
private void |
_fireRequestStarted(HttpServletRequest req) |
private void |
_initAmetys() |
private void |
_initAmetysHome() |
private void |
_initLogger() |
private void |
_initPlugins() |
private void |
_loadRuntimeConfig() |
private void |
_renderError(HttpServletRequest req,
HttpServletResponse res,
Throwable throwable,
String message) |
private String |
_retrieveUri(HttpServletRequest req) |
void |
destroy() |
static RuntimeServlet.RunMode |
getRunMode()
Get the run mode
|
void |
init() |
void |
restartCocoon(HttpServletRequest req)
Restart cocoon
|
void |
service(HttpServletRequest req,
HttpServletResponse res) |
static void |
setRunMode(RuntimeServlet.RunMode mode)
Set the run mode
|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
public static final String CONTEXT_SERVLET_CONFIG
ServletConfig
in the Avalon contextpublic static final String CONTEXT_CONTEXT_ROOT
public static final String COCOON_CONF_URL
public static final int DEFAULT_MAX_UPLOAD_SIZE
public static final String CONFIG_FILE_NAME
public static final String AMETYS_HOME_PROPERTY
public static final String AMETYS_HOME_DEFAULT
private static RuntimeServlet.RunMode _mode
private ServletContext _servletContext
private String _servletContextPath
private URL _servletContextURL
private DefaultContext _avalonContext
private HttpContext _context
private RequestFactory _requestFactory
private int _maxUploadSize
private File _uploadDir
private File _ametysHome
private AmetysHomeLock _ametysHomeLock
private LoggerManager _loggerManager
private Exception _exception
private Collection<Pattern> _allowedURLPattern
public RuntimeServlet()
public void init() throws ServletException
init
in class GenericServlet
ServletException
private void _initAmetysHome() throws AmetysHomeLockException
AmetysHomeLockException
private void _initAmetys() throws Exception
Exception
private void _initLogger()
private void _createCocoon() throws Exception
Exception
private void _initPlugins() throws Exception
Exception
private void _loadRuntimeConfig() throws ServletException
ServletException
public void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
private final void _disposeCocoon()
public final void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
service
in class HttpServlet
ServletException
IOException
public void restartCocoon(HttpServletRequest req)
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.private String _retrieveUri(HttpServletRequest req)
private void _fireRequestStarted(HttpServletRequest req)
private void _fireRequestEnded(HttpServletRequest req)
public static void setRunMode(RuntimeServlet.RunMode mode)
mode
- the running modepublic static RuntimeServlet.RunMode getRunMode()
private void _renderError(HttpServletRequest req, HttpServletResponse res, Throwable throwable, String message) throws ServletException
ServletException