public final class InitServlet
extends javax.servlet.http.HttpServlet
implements javax.servlet.Servlet
This servlet does not return any data, it is simply used to initialise some data, and therefore
only implements the init(ServletConfig)
method.
The GenericServlet.init()
method performs a sanity check to inform the user about which
version of Berlioz is running and which configuration files are used.
Typically this servlet should be configured in the Web Configuration (web.xml) as:
<!-- Initialisation servlet -->
<servlet>
<servlet-name>Initialiser</servlet-name>
<servlet-class>org.pageseeder.berlioz.servlet.InitServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
Constructor and Description |
---|
InitServlet() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Reset the initialisation Berlioz.
|
String |
getServletInfo() |
void |
init(javax.servlet.ServletConfig config)
Initialises Berlioz.
|
static void |
registerListener(LifecycleListener listener)
Add a listener to invoke when the Berlioz starts or stops.
|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
This method displays the configuration setting and does the following in order:
services.xml
is available;Log4j
if possible;start
method of the LifecycleListener
.init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
config
- The servlet configuration.javax.servlet.ServletException
- Should an exception occur.public void destroy()
This method unload the configuration setting and does the following in order:
stop
method of the ConfigListener
.destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
public String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
public static void registerListener(LifecycleListener listener)
listener
- The listener to register.Copyright © 2016 Allette Systems. All rights reserved.