janus.web
Class ConfigServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by janus.web.ConfigServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class ConfigServlet
extends HttpServlet

Servlet zur Konfiguration aller Komponenten.

Dieses Servlet wird automatisch geladen und initialisiert die folgenden Klassen und Systeme:

  1. Log4jConfig - Loggingkonfiguration
  2. PoolConfig - Verbindungskonfiguration zum HP-NonStop-Host
  3. ServiceConfig - Konfiguration der Dienste
  4. TimerConfig - Konfiguration wiederkehrender Abläfe

Es können Servlet-Parameter mit den entsprechenden Namen gesetzt werden, um die Konfiguratitonsdateien zu spezifizieren.

Die Standarddateien sind:

  1. log4j.properties
  2. pool.properties
  3. service.properties
  4. timer.properties

Die Dateien werden mit Hilfe des ServletResourceLoader gefunden und sollten daher im WEB-INF-Verzeichnis liegen.

See Also:
Serialized Form

Field Summary
static String appServer
          Name des Application-Servers
static String documentBase
          Der Basis-Pfad der Web-Applikation (z.B. für das Logging)
static String statusUrl
          Die URL der Status-Seite
 
Constructor Summary
ConfigServlet()
           
 
Method Summary
static void configure()
          Initialisiere alle Resourcen.
 void destroy()
          Servlet wird entladen: Stoppe alles
 void doGet(HttpServletRequest req, HttpServletResponse resp)
          Damit man auch etwas sieht :-)
 void doPost(HttpServletRequest req, HttpServletResponse resp)
          Einzelkonfiguration vom Browser aus.
static ConfigServlet getInstance()
          Mache die Instanz global verügbar
 void init()
          Initialisiere alle Resourcen beim Start.
 boolean isUpdateAllowed(HttpServletRequest req)
          Darf der Benutzer einen Update durchführen?
 void log(String text)
          Logging ins Server-Log und in Log4J.
 void log(String text, Throwable t)
          Logging ins Server-Log und in Log4J.
static void stop()
          Stoppe alle Resourcen.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

appServer

public static String appServer
Name des Application-Servers


documentBase

public static String documentBase
Der Basis-Pfad der Web-Applikation (z.B. für das Logging)


statusUrl

public static String statusUrl
Die URL der Status-Seite

Constructor Detail

ConfigServlet

public ConfigServlet()
Method Detail

configure

public static void configure()
Initialisiere alle Resourcen. Diese Methode ist auch Eintrittspunkt für Tests ohne Servlet.


destroy

public void destroy()
Servlet wird entladen: Stoppe alles

Specified by:
destroy in interface Servlet
Overrides:
destroy in class GenericServlet

doGet

public void doGet(HttpServletRequest req,
                  HttpServletResponse resp)
           throws ServletException,
                  IOException
Damit man auch etwas sieht :-)

Overrides:
doGet in class HttpServlet
Throws:
ServletException
IOException

doPost

public void doPost(HttpServletRequest req,
                   HttpServletResponse resp)
            throws ServletException,
                   IOException
Einzelkonfiguration vom Browser aus.

Overrides:
doPost in class HttpServlet
Throws:
ServletException
IOException

getInstance

public static ConfigServlet getInstance()
Mache die Instanz global verügbar


init

public void init()
Initialisiere alle Resourcen beim Start. Wird beim Laden des Servlet automatisch ausgeführt.

Overrides:
init in class GenericServlet

isUpdateAllowed

public boolean isUpdateAllowed(HttpServletRequest req)
Darf der Benutzer einen Update durchführen?

Parameters:
req - Der Request aus doGet bzw. doPost

log

public void log(String text)
Logging ins Server-Log und in Log4J. Bei späteren Reloads wird auch in logBuffer geschrieben, damit der Text in der HTML-Seite angezeigt werden kann.

Overrides:
log in class GenericServlet

log

public void log(String text,
                Throwable t)
Logging ins Server-Log und in Log4J. Bei späteren Reloads wird auch in logBuffer geschrieben, damit der Text in der HTML-Seite angezeigt werden kann.

Overrides:
log in class GenericServlet

stop

public static void stop()
Stoppe alle Resourcen.



Copyright © 2008 MvC Systemsoftware.