java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.RuntimeCollective.webapps.servlet.InitialiserServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public final class InitialiserServlet
- extends javax.servlet.http.HttpServlet
This servlet initializes the Runtime webapps environment using the initialisation parameters. These parameters are of the following kinds:
- Beans -- parameters used to register beans on an EntityBeanStore, where the name of the parameter is bean.bean_class_name (for example, 'bean.com.RuntimeCollective.webapps.bean.SimpleUser') and the value is the name of the class of EntityBeanStore where they should be stored (for example, 'com.RuntimeCollective.webapps.SimpleEntityBeanStore').
.
- Parameters -- general purpose parameters registered on RuntimeParameters, where the name of the parameter is param.param_name
and the value is that given.
- Properties -- System properties that will be set with
System.setProperty, where the name of the parameter is property.property_name and the value is that given.
- Database -- One or more RDBMS data sources can be defined. The parameters for the first are defined as db.*, the second as db.1.*, and so on. Once defined, these data sources can be accessed using
RuntimeDataSource.
db.alias: Alias of the database. This will then be used by RuntimeDataSource to identify the database. If only one database is defined, then no alias is required.
db.JDBCDriverClass: Name of JDBC driver class (eg oracle.jdbc.driver.OracleDriver).
db.maxConnections: Maximum number of connections to maintain in the DB pool.
db.minConnections: Minimum number of connections to maintain in the DB pool.
db.user: User name for DB access
db.password: Password for DB access
db.url: URL of the database (eg. jdbc:oracle:thin:@sirius:1521:infodb)
- Log -- Define the logger used by this application. If none is defined then logging messages are sent to System.out by default. Otherwise, different types of log can be configured using the following parameters:
log.level: The (lowest) level of log output required. Any of FATAL, ERROR, WARN, INFO, or DEBUG.
log.host: The name of the host on which a log4J reader is running, and the port that it is listening to (eg 'localhost:8801'). If the port is not defined, then output is send to port 4445 by default. To read the output of this log, try using Lumbermill or Chainsaw.
log.file: The name of a file to send logging messages to in Log4j SimpleLayout (human readable).
log.xmlFile: The name of a file to send logging messages to in Log4j xml format (readable using Chainsaw).
log.htmlFile: The name of a file to send logging messages to in Log4j html format (readable using a browser).
- Version:
- $Id: InitialiserServlet.java,v 1.26 2003/10/15 11:14:16 joe Exp $
| Fields inherited from class javax.servlet.http.HttpServlet |
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InitialiserServlet
public InitialiserServlet()
init
public void init()
throws javax.servlet.ServletException
- Initialize the environment.
initLogging
private void initLogging(javax.servlet.ServletConfig sc)
- Initialise the logger.
setLogLevel
private void setLogLevel(java.lang.String logLevel)
- Set the root log level, specified in web.xml as a String.
initParameters
private void initParameters(javax.servlet.ServletConfig sc)
- Initialise the parameters object.
initProperties
private void initProperties(javax.servlet.ServletConfig sc)
- Initialise the system properties.
initProxy
private void initProxy(javax.servlet.ServletConfig sc)
- Initialise the use of an http proxy for all
java.net.URLConnections,
if we have the web.xml parameters param.proxyHost and proxyPort
initDataSource
private void initDataSource(javax.servlet.ServletConfig sc)
throws javax.servlet.ServletException
- Initialise the datasource.
initBeanStore
private void initBeanStore(javax.servlet.ServletConfig sc)
throws javax.servlet.ServletException
- Initialise the bean store.
initUserGroups
private void initUserGroups(javax.servlet.ServletConfig sc)
throws javax.servlet.ServletException
- Initialise the UserGroups object.
initMailSession
private void initMailSession(javax.servlet.ServletConfig sc)
throws javax.servlet.ServletException
- Initialise the JavaMail Session object.
destroy
public void destroy()
- Gracefully shut down this servlet, releasing any resources
that were allocated at initialization.